What Are the Values Submitted on Submit Button Fields

Q

What Are the Values Submitted on Submit Button Fields? - XHTML 1.0 Tutorials - Understanding Forms and Input Fields

✍: FYIcenter.com

A

A "submit" button input field does not allow viewers to enter any input values directly. But if a form is submitted, "submit" button input fields will be submitted with values based on the following rules:

  • If a "submit" button is not clicked, no value will be submitted for this submit button.
  • If a "submit" button is clicked and no "name" attribute is specified, no value will be submitted for this submit button.
  • If a "submit" button is clicked, "name" attribute is specified, and no "value" is specified, "Submit Query" will be submitted as the value.
  • If a "submit" button is clicked, "name" attribute is specified, and "value" is specified, The specified value will be submitted as the value.

If you use the previous tutorial example, you can test the following cases:

1. If you push the first submit button, you will get the following value submitted:

http://localhost/submit?channel=google

2. If you push the second submit button, you will get the following values submitted:

http://localhost/submit?channel=google

3. If you push the third submit button, you will get the following values submitted:

http://localhost/submit?channel=google&action=Submit

4. If you push the forth submit button, you will get the following values submitted:

http://localhost/submit?channel=google&action=Cancel

2007-05-12, 5117👍, 0💬