我从这里搜索并找到了不错的代码。使用 jQuery 提交表单
<input type='button' value='Submit form' onClick='submitDetailsForm()' />
<script language ="javascript" type = "text/javascript" >
function submitDetailsForm()
{
$("#formId").submit();
}
</script>
但是你能告诉我如何在一个页面中处理多个表单吗?
<form id="myForm1" action="comment.php" method="post"></form>
<form id="myForm2" action="comment.php" method="post"></form>
<form id="myForm3" action="comment.php" method="post"></form>
<form id="myForm4" action="comment.php" method="post"></form>