search form
<form action="category.php?type=search" method="post">
select all delete form
<form name="frmMain" method="post">
</form>
</form>
&#13;
答案 0 :(得分:1)
如果您使用php发送表单,那么下面是正确的方法:
//search form
<form action="category.php?type=search" method="post">
</form>
//select all delete form
<form name="frmMain" method="post">
</form>
如果你想使用ajax和jquery发送表单,那么你可以使用这种方式:
//search form
<form action="category.php?type=search" method="post">
//select all delete form
<form name="frmMain" method="post">
</form>
</form>
HTML示例:5个新表单元素(来自answer ilevent):
<form id="saveForm" action="/post/dispatch/save" method="post"></form> <form id="deleteForm" action="/post/dispatch/delete" method="post"></form> <div id="toolbar"> <input type="text" name="foo" form="saveForm" /> <input type="hidden" value="some_id" form="deleteForm" /> <input type="text" name="foo2" id="foo2" form="saveForm" value="success" /> <input type="submit" name="save" value="Save" form="saveForm" onclick="alert(document.getElementById('deleteForm').elements.length + ' ' + document.getElementById('saveForm').elements.length + ' ' + document.getElementById('saveForm').elements['foo2'].value);return false;" /> <input type="submit" name="delete" value="Delete" form="deleteForm" /> <a href="/home/index">Cancel</a> </div>