JavaScript form submit using image: example

The code:


<form name="myform" action="handle-data.php">
Search: <input type='text' name='query'>
<A href="javascript: submitform()"
><img src="go.gif" width="33" height="19" border="0"
></A>
</form>

<SCRIPT language="JavaScript1.2">
function submitform()
{
 if(document.myform.onsubmit())
 {
 document.myform.submit();
 }
}
</SCRIPT>

The form created by the code above:

Search: form submit

Back to Article (more samples and cases):
How To Submit a Form Using JavaScript


Build Web Forms Faaaast!!

Using Simfatic Forms it is very easy to design, create, install and maintain web forms; no coding required!

Simfatic Forms

Quickly create your form, install it and receive form submissions by email.
Click here for more info


Tutorials & Articles
HTML Form Tutorial
Form design software
JavaScript Form Validation
JavaScript Form Handling
JavaScript Button
JavaScript Popup Windows
The window.open method
The window.close method
More ...

 
.   Copyright © 2003-2008 Simfatic Solutions. All rights reserved.