[英]add/remove multiple input fields and input rows dynamically PHP (Dynamic form In Dynamic Form)
我正在制作动态 PHP 表单,我已经成功制作了动态表单,如果我想在动态字段中使表单动态化,例如在表格中创建动态行中的动态字段,该怎么办?
$(document).ready(function(){
var count = 0;
$(document).on('click', '#addformdanger', function(){
count++;
var html = '';
html += '<section>';
html += '<hr>';
html += 'my child form';
$('#form-body-danger').append(html);
});
$(document).on('click', '#addprocess', function(){
count++;
var html = '';
html += '<section>';
html += '<hr>';
html += 'form child';
$('#form-body-process').append(html);
});
$(document).on('click', '.remove-danger',function(){
$(this).closest('section').remove();
});
$(document).on('click', '.remove-process',function(){
$(this).closest('section').remove();
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.