ton*_*lfx 1 php jquery dynamic textinput
我有一个动态的多文本输入:
<input type="text" id="text_1">
<input type="text" id="text_2">
<input type="text" id="text_3">
<input type="text" id="text_4">
<input type="text" id="text_5"> ....
Run Code Online (Sandbox Code Playgroud)
如何使用jQuery编辑每个textinput上的id:
$('#form').submit(function(){
$.post('include/setting.php', {
text_(id): $('#text_(id)').val(), // <--
}, 'json')
return false;
})
Run Code Online (Sandbox Code Playgroud)
用PHP如何获取输入ID?
$('#form').submit(function(){
$('#form input[id]').each(function(){
$(this).attr('name', $(this).attr('id'));
});
$.post('include/setting.php', $('#form').serialize());
return false;
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
569 次 |
| 最近记录: |