I am sending two forms at the same time but there is an error in my script. I've researched the error - Uncaught TypeError: Property 'submit' of object # is not a function. They told me to add a submit button but there is a submit button already here is my form
<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>
Here is my jquery:
jQuery.post("form2.php", jQuery("#form2").serialize(), function(data){
if(data.trim()=='valid'){
document.form1.submit();
}
});