How can I make a form with my own "submit" button & post the info to a php server side?
how can I get js to post it?
How can I make a form with my own "submit" button & post the info to a php server side?
how can I get js to post it?
You can use the submit()
method to submit forms via javascript:
document.form_name.submit();
Or:
document.getElementById('form_id').submit();
Or:
document.forms[0].submit(); // submit first form on page
document.forms[1].submit(); // submit second form on page
If you don't want to use a submit
button and want to use a normal button, you just need to put any of the above code in onclick
event of that button.
<form id=myForm action=process.php>
<input name=text>
<INPUT TYPE="image" SRC="images/submit.gif">
</form>
To submit
document.getElementById('myForm').submit();