Home > DeveloperSection > Interviews > How can we submit a form without a submit button?

Posted on    March-18-2011 12:00 AM

 JavaScript JavaScript 
 1 Answer(s)
  1251  View(s)
Rate this:

Sanjay Sharma
Sanjay Sharma

Total Post:42

Posted on    March-18-2011 12:00 AM

If you don't want to use the Submit button to submit a form, you can use normal hyper links to submit a form. But you need to use some JavaScript code in the URL of the link. For example:

<a href="javascript: document.myformsample.submit();">Submit</a>

A form can be submitted in various ways without using submit button.

Submitting a form by clicking a link
Submitting a form by selecting an option from drop down box with the invocation of onChange event
Using java script : document.form.submit();
Using header(“location:page.php”);

Modified On Apr-04-2016 12:26:02 AM

Don't want to miss updates? Please click the below button!

Follow MindStick