[英]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.