Products
Services
Contact Us

Scripts: Javascript :: Forms :: Library Article #1

Developer's Section

Submit a form using Javascript
By: Erobo Team Member

Hire a Developer for Related Work / Installation | $55 hr
Rating:  | Rate It:   
Average Votes: (1673)
Favorites:

Learn simple steps to successfully submit a form using Javascript.

It is relatively simple to submit a form using Javascript, Perhaps one of the easiest tricks. in this two step guide we will learn how to do this.

Step 1: Define form elements:

 Code Snippet 1
<form name="new_form" action="myscript.cgi" method="POST">
<input type="text" name="Input1" value="Value1">
</form>


Step 2: Place Javascript

After that we just need to do the key trick. That is to display a little javascript indicating when to submit the form. so you can use something like:

 Code Snippet 2
<script type="text/javascript">
function submitMyForm()
{
    document.new_form.submit()
}
</script>
<p align="center"><a href="javascript:submitMyForm()">Submit</a></p>

that's it. I hope you enjoy it!.


See other Scripts in Forms

 

Submit Your Scripts:


System Message:
  • Your Javascript script has been sent. Please allow 48 hours for processing.


If you would like to have your Javascripts published in this section please fill out
the form below:
*Your Name or Username:
Home Town:
*Email:
*Description and Code:
*Enter Code shown
to the right:

[ Refresh Image ]