Can I have two or more Submit buttons in the same form?
Submitted by: AdministratorYes. This is part of HTML 2.0 Forms support (some early browsers did not support it, but browser coverage is now excellent).
The submit buttons must have a NAME attribute. The optional VALUE attribute can be used to specify different text for the different submit buttons.
To determine which submit button was used, you need to use different values for the NAME and/or VALUE attributes. Browsers will send to the server the name=value pair of the submit button that was used. Here is an example:
<input type="submit" name="join" value="I want to join now">
<input type="submit" name="info" value="Please send full details">
Note that if you are using image submit buttons, you need to provide different NAME attributes for them too. Also, browser behavior can be inconsistent when the form is submitted without a submit button (e.g., by hitting ENTER).
If you're unsure what results you're going to get when you submit your form, TipJar has a standard script which you can use. Code this, for example (assuming method "post"):
<form method="post" action="http://www.yoursite.com/cgi-bin/test">
and then go through the motions of submitting your form. The TipJar server decodes the form input, and displays the result to you.
Submitted by: Administrator
The submit buttons must have a NAME attribute. The optional VALUE attribute can be used to specify different text for the different submit buttons.
To determine which submit button was used, you need to use different values for the NAME and/or VALUE attributes. Browsers will send to the server the name=value pair of the submit button that was used. Here is an example:
<input type="submit" name="join" value="I want to join now">
<input type="submit" name="info" value="Please send full details">
Note that if you are using image submit buttons, you need to provide different NAME attributes for them too. Also, browser behavior can be inconsistent when the form is submitted without a submit button (e.g., by hitting ENTER).
If you're unsure what results you're going to get when you submit your form, TipJar has a standard script which you can use. Code this, for example (assuming method "post"):
<form method="post" action="http://www.yoursite.com/cgi-bin/test">
and then go through the motions of submitting your form. The TipJar server decodes the form input, and displays the result to you.
Submitted by: Administrator
Read Online HTML Job Interview Questions And Answers
Top HTML Questions
☺ | Explain Posting Copy and Paste HTML? |
☺ | What is a DOCTYPE? Which one do I use? |
☺ | How can I include comments in HTML? |
☺ | What is everyone using to write HTML? |
☺ | Do search engines dislike frames? |
Top Top World Wide Web Categories
☺ | Cascading Style Sheet CSS Interview Questions. |
☺ | HTML5 Interview Questions. |
☺ | Basic Internet Interview Questions. |
☺ | Domain Name System (DNS) Interview Questions. |
☺ | JavaScript Interview Questions. |