HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 17. FORMS AND INPUTS 179


The entire file will be uploaded when the form is submitted.


type=hidden


<input type=hidden ...>is the tag for a hidden field. The information in
this field is generally not seen or modified by the user. It is put there by the
server when the webpage is created, and it is sent back to the server when
the form is submitted. Hidden fields and cookies are the main ways that the
server can keep track of many conversations (sessions) going on with many
browsers all at the same time.


The only useful parameters are: name, value.


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


Thenameparameter is normal.


Thevalueparameter is not displayed to the user. It is hidden. That’s the
whole point. But it is transmitted when the form is submitted.


17.3.4 HTML5 Input Types


There are several new HTML5 type= attributes. These may become more
useful in the future. They may not work in any special way, but they are
always safe to use because when a browser does not understand one of these,
it will use type=text instead.


For dates and times: type=datetime, type=datetime-local, type=date, type=month,
type=time, and type=week.


For numbers: type=number and type=range.


For colors: type=color.


For special types of data: type=email, type=url, type=tel, and type=search.


17.4 The Textarea Tag


textareaprovides a rectangular space where several lines of information
can be entered. It has a required end tag.


Thetextareatag has a name but the value is not specified inside the tag.
The value is whatever appears between thetextareatag and its ending tag,

Free download pdf