|
The HTML Form Submit Button
The basics of an HTML form submit button is discussed first in this article,
moving towards more advanced topics like multiple submit buttons.
Note: If you are looking for a software tool for creating HTML forms quickly ( without even knowing HTML), see the article: How to make a web form and get it online quickly. This article contains more information about Simfatic Forms - an easy to use form creation software.
In order to create an HTML form submit button, you can use the HTML code below: name: specifies the identification assigned to this submit button.value: is the label that appears on the button.
The code above will create the submit button as shown below: Identifying the submit button on the server side
The name and value of the button that is used to
submit the form is passed along with the other data to the server script.
For the button above, when you click on the submit button, the data passed to the
server side script is mysubmit=Click!
Having Multiple Submit buttons
You can have more than one submit button in a form.
But, how to identify from the server side which button submitted the form?
One way is to have different names for the submit buttons.
In the server side script you can do a check like this:
and in the server side it could be handled like this: Switching the 'action' field dynamically
It is commonly required to switch the action field of the
dynamically based on certain conditions.
Read: Switching HTML form 'action' field dynamically
How to submit a form on click of a hyperlink or an image? You can find more on HTML Forms in the HTML Form Tutorial Using Simfatic forms, it is simple, quick & easy to create HTML forms. Click here for more info. |
|
. Copyright © 2003-2009 JavaScript-coder.com. All rights reserved. |
||