【发布时间】:2017-11-06 00:06:35
【问题描述】:
我有一个包含多个输入框的表单。并以这种形式进行多克隆。
如何使用 web py 将所有表单插入到数据库中?
这是克隆代码:
function resetForm($$form) {
$$form.find('input:text, input:password, input:file, select, textarea').val('');
$$form.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected');
}
var count = 0;
var $$clonedata = $$('.form_data').clone();
resetForm($$clonedata);
$$(document).on('click', '.Add', function(e) {
e.preventDefault();
count++;
$$clonedata.clone().appendTo('#form_data').attr('id','form_data');
});
$$('#form_data').on('click', '.Remove', function(e) {
e.preventDefault();
$$(this).closest('.form_data').remove();
});
【问题讨论】:
-
如果您向您展示 HTML,那么它会很容易为所有 SO 用户提供帮助。
-
-
我认为只需一点improvement,您的问题可能看起来很多更好。看,我的编辑后它看起来有多好。你也可以做到。顺便说一句,目前还不清楚。