Aims:
form tag and its attributesform element has two attributes, action and
method:
<form action="process.php" method="get">
…
</form>
input tag and the type and name attributesinput element (which
is a void element)type attribute specifies what kind of control we want:
New to HTML5 are:
text,password,checkbox,radio,button
image,file,hidden,submit,reset
url,date,time,datetime,month,
week,number,range,search,tel,color
name attribute is also required for all types except
submit and reset
input element with type="text":<input type="text" />
<input type="text" name="surname" />
size attribute to change its width:<input type="text" name="surname" size="25" />maxlength attribute to restrict this:<input type="text" name="surname" size="25" maxlength="25" />
value attribute to supply your own initial value:<input type="text" name="town" size="25" maxlength="25"
value="Cork" />
disabled="disabled"
input element with attribute type="reset":<input type="reset" />
value attribute:<input type="reset" value="CLEAR" />
input element with attribute type="submit":<input type="submit" />
value attribute:<input type="reset" value="GO!" />
firstname=Hugh&surname=Jeegoh
firstname=Ann&surname=O%20Domini
method attributeaction attributemethod="get", the data is added to the end of the URL
after a question mark, e.g.:
GET process.php?firstname=Hugh&surname=Jeegoh
method="get", you can submit your data directly without using
a form
http://www.cs.ucc.ie/~dgb/courses/pwd/19/process.php?firstname=Hugh&surname=Jeegoh
<a href="http://www.cs.ucc.ie/~dgb/courses/pwd/19/process.php?firstname=Hugh&surname=Jeegoh">Click here</a>