Building the User Interface by Using HTML5: Organization ... - server

Building the User Interface by Using HTML5: Organization ... - server Building the User Interface by Using HTML5: Organization ... - server

cna.mikkeliamk.fi
from cna.mikkeliamk.fi More from this publisher
23.05.2015 Views

74 | Lesson 3 Table 3-4 continued CERTIFICATION READY Which HTML5-specific attributes do you use for restricting form input? 2.5 ATTRIBUTE VALUE DESCRIPTION method get Specifies the HTTP (transmission) method post used when sending form data; use “get” for retrieving data and use “post” for storing or updating data or sending email LICENSED PRODUCT NOT FOR RESALE name text Specifies the name of a form, which is used to reference form data after a form is submitted novalidate** novalidate A Boolean attribute that specifies that the form data (user input) should not be validated when submitted; HTML5 also allows Boolean attributes to be set by mentioning the attribute without an equals sign or assigned value target _blank Specifies where to display the response _self received after submitting the form _parent _blank loads the response in a new, _top unnamed browser window _self loads the response in the current window; this is the default, so it’s use isn’t required _parent loads the response in the parent window (the browser window that opens the form window) _top loads the response in the full browser window **New in HTML5. HTML5 introduces numerous input element attributes. The attributes for the input element are listed in Table 3-5; new attributes in HTML5 are indicated by a double asterisk. Table 3-5 Input element attributes used in HTML5 ATTRIBUTE VALUE DESCRIPTION accept audio/* Specifies file types the server accepts; used video/* only for type="file" image/* MIME_type alt text Specifies alternate text for images; used only for type="image"; commonly used when creating a custom Submit button from your own image file autocomplete** on Specifies whether autocomplete is on or off off in a form or input field; can be “on” for specific input fields and “off” for the form, or vice versa (continued)

Building the User Interface by Using HTML5: Organization, Input, and Validation | 75 Table 3-5 continued ATTRIBUTE VALUE DESCRIPTION autofocus** autofocus A Boolean attribute, specifies that a control is to be focused, or selected, as soon as the page loads LICENSED PRODUCT NOT FOR RESALE checked checked Specifies that an input element be preselected upon page load; used only for type="checkbox" or type="radio" disabled disabled Disables an input element form** form_id Specifies the form (or multiple forms) an input element belongs to formaction** URL Specifies the Web address of the file that will process the input control when the form is submitted formenctype** application/x- Specifies the encoding type for form www-form- data when submitting the data to urlencoded a server; used only for method=”post” multipart/ form-data text/plain formmethod** get Specifies the HTTP (transmission) method post used for sending form data to a Web address formnovalidate** formnovalidate A Boolean attribute that prevents validation when submitting input formtarget** _blank Specifies a keyword that indicates _self where to display the response _parent received after submitting the form _top framename height pixels Specifies the height of an input element; used only with input type="image" list** datalist_id Refers to a datalist element that contains predefined content to autocomplete input, such as selecting an item from a dropdown list max** number Specifies the maximum value for an input date element min** number Specifies the minimum value for an input date element multiple** multiple A Boolean attribute that specifies the user may enter multiple values pattern** regexp Provides a format (a regular expression) for the input field; the input element’s value is checked against the expression (continued)

<strong>Building</strong> <strong>the</strong> <strong>User</strong> <strong>Interface</strong> <strong>by</strong> <strong>Using</strong> <strong>HTML5</strong>: <strong>Organization</strong>, Input, and Validation | 75<br />

Table 3-5<br />

continued<br />

ATTRIBUTE VALUE DESCRIPTION<br />

autofocus** autofocus A Boolean attribute, specifies that a control<br />

is to be focused, or selected, as soon as <strong>the</strong><br />

page loads<br />

LICENSED PRODUCT NOT FOR RESALE<br />

checked checked Specifies that an input element be preselected<br />

upon page load; used only for<br />

type="checkbox" or type="radio"<br />

disabled disabled Disables an input element<br />

form** form_id Specifies <strong>the</strong> form (or multiple forms)<br />

an input element belongs to<br />

formaction** URL Specifies <strong>the</strong> Web address of <strong>the</strong> file that will<br />

process <strong>the</strong> input control when <strong>the</strong> form is<br />

submitted<br />

formenctype** application/x- Specifies <strong>the</strong> encoding type for form<br />

www-form-<br />

data when submitting <strong>the</strong> data to<br />

urlencoded a <strong>server</strong>; used only for method=”post”<br />

multipart/<br />

form-data<br />

text/plain<br />

formmethod** get Specifies <strong>the</strong> HTTP (transmission) method<br />

post<br />

used for sending form data to a Web<br />

address<br />

formnovalidate** formnovalidate A Boolean attribute that prevents validation<br />

when submitting input<br />

formtarget** _blank Specifies a keyword that indicates<br />

_self<br />

where to display <strong>the</strong> response<br />

_parent<br />

received after submitting <strong>the</strong> form<br />

_top<br />

framename<br />

height pixels Specifies <strong>the</strong> height of an input element;<br />

used only with input type="image"<br />

list** datalist_id Refers to a datalist element that contains<br />

predefined content to autocomplete input,<br />

such as selecting an item from a dropdown<br />

list<br />

max** number Specifies <strong>the</strong> maximum value for an input<br />

date<br />

element<br />

min** number Specifies <strong>the</strong> minimum value for an input<br />

date<br />

element<br />

multiple** multiple A Boolean attribute that specifies <strong>the</strong> user<br />

may enter multiple values<br />

pattern** regexp Provides a format (a regular expression) for<br />

<strong>the</strong> input field; <strong>the</strong> input element’s value is<br />

checked against <strong>the</strong> expression<br />

(continued)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!