Form Container and Submission Attributes
This chapter focuses on attributes that control how a form behaves as a whole when data is prepared and submitted.
Main Tags Covered
<form><fieldset><legend><label><output><datalist>
<form> Attributes
actionmethodautocompletenovalidatetargetnameenctypeaccept-charset
Possible method values:
getpost
Common enctype values:
application/x-www-form-urlencodedmultipart/form-datatext/plain
<fieldset> and <legend>
Purpose:
- group related controls
- provide a visible group label
Useful attributes:
disabledon<fieldset>- global attributes on both elements
<label> Attributes
for
Purpose:
- connects label text to a control
<output> Attributes
forname
Purpose:
- displays calculation results from form inputs
<datalist> Usage
Purpose:
- provides suggestions for an input
Connected through:
liston<input>idon<datalist>
Example:
<label for="city">City</label>
<input id="city" name="city" list="cities">
<datalist id="cities">
<option value="Mumbai">
<option value="Delhi">
</datalist>