HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 17. FORMS AND INPUTS 176


image map.


type=submit


<input type=submit ...>is the tag for a submit button.


In some ways, this is the most important input field. Without it, some
browsers will not ever allow your form to be submitted.


Exactly one submit button will be transmitted to yourCGIprogram.


The name=value from the submit button will be transmitted, along with all
the other fields in the form, when you click on the submit button.


JavaScript can be used to intercept the submit button and do something
else.


The most important parameters are: name, value.


Thename=parameter is normal.


Thevalue=parameter will be visually displayed on the submit button.


17.3.3 Non-Button Inputs


Exam Question 310(p.354): List the six old-school non-button type=
attributes for the input tag.
Required Answer:text, password, checkbox, radio, file, hidden


Besides these attributes, there are several new (HTML5) type= attributes
that we mention below.


type=text


The text field is almost equal to the submit button in importance.


<input type=text ...>is the tag for a text field. It provides one line of
data entry space for the user to type in something.


If no type is found, the default is text. If a type is found but cannot be
understood by the browser, it is presumed to be text.


The most important parameters arenameandvalue.


The name=value will be transmitted when your form is submitted.

Free download pdf