我同时发送两个表格,但我的脚本中有错误。我研究了错误 - Uncaught TypeError: Property 'submit' of object # is not a function。他们告诉我添加一个提交按钮,但这里已经有一个提交按钮是我的表单
<form name="form1" id="form1" method="post" action="page1.php">
<input type="hidden" name="pt" id="pt" value="<?=$b64string?>" style="width:800px; padding: 10px;">
<input type="submit" value="submit" name="submit"/>
</form>
<form name="form2" id="form2" method="post" action="page2.php">
<input type="hidden" name="signature" value="<?=$_sign?>"/>
<input type="submit" value="submit" name="submit">
</form>
<span onclick="submitBoth();" style="cursor:pointer;"><img src="image1.png"></span>
这是我的jQuery:
jQuery.post("form2.php", jQuery("#form2").serialize(), function(data){
if(data.trim()=='valid'){
document.form1.submit();
}
});