I want to submit a form with js function, and in the php action page I want to check if the form is submitted or not, here is my code:
<form method="post" action="index.php" name="form1">
<fieldset>
...
</p><div class="clearfix"></div>
<input type="button" id="send1" onclick="validateForm1();" class="comment_submit" value="SUBMIT" name="send1"><p></p>
</fieldset>
</form>
and this is the js:
function validateForm1(){
var name = document.getElementById('fullName');
...
if(isNotEmpty(name))
...
document.forms['form1'].submit();
}
so how I can check if the form is submitted or not, without using if(!empty($_POST)) because I have 2 forms will be submitted to the same action page.