html forms

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

<input type="search">

<input type="search">

<form>

Defines an HTML form for user input element is a container for different types of input elements, such as: text fields, checkboxes, radio buttons, submit buttons,

<input>

Defines an input control most used form element,can be displayed in many ways, depending on the type attribute

placeholder

Input Attribute a short hint that describes the expected value of an input field (a sample value or a short description of the expected format). displayed in the input field before the user enters a value. The placeholder attribute works with text, search, url, tel, email, and password

autofocus

Input Attribute an input field should automatically get focus when the page load

height and width

Input Attribute attributes that specify the height and width of an <input type="image"> element Always specify both the height and width attributes for images. If height and width are set, the space required for the image is reserved when the page is loaded. Without these attributes, the browser does not know the size of the image, and cannot reserve the appropriate space to it. The effect will be that the page layout will change during loading (while the images load)

input list attribute

Input Attribute refers to a <datalist> element that contains pre-defined options for an <input> element (limits input to items that are on the list)

autocomplete attribute

Input Attribute specifies whether a form or an input field should have autocomplete on or off. Autocomplete allows the browser to predict the value. When a user starts to type in a field, the browser should display options to fill in the field, based on earlier typed values. The autocomplete attribute works with <form> and the following <input> types: text, search, url, tel, email, password, datepickers, range, and color.

multiple attribute

Input Attribute the user is allowed to enter more than one value in an input field works with email and file inputs

size

Input Restriction Input Attribute Specifies the width (in characters) of an input field The default value for size is 20. Note: The size attribute works with the following input types: text, search, tel, url, email, and password.

checked

Input Restriction Input Attribute an input field should be pre-selected when the page loads (for type="checkbox" or type="radio")

pattern

Input Restriction Input Attribute Specifies a regular expression to check the input value against works with text, date, search, url, tel, email, and password inputs * use a <title> to describe the pattern to help the user.

value

Input Restriction Input Attribute Specifies the default value for an input field

step

Input Restriction Input Attribute Specifies the legal number intervals for an input field Example: if step="3", legal numbers could be -3, 0, 3, 6, etc. Tip: This attribute can be used together with the max and min attributes to create a range of legal values. works with: number, range, date, datetime-local, month, time and week.

disabled

Input Restriction Input Attribute an input field should be disabled A disabled input field is unusable and un-clickable. The value of a disabled input field will not be sent when submitting the form!

readonly

Input Restriction Input Attribute input field is read only (cannot be changed) A read-only input field cannot be modified (however, a user can tab to it, highlight it, and copy the text from it). The value of a read-only input field will be sent

required

Input Restriction Input Attribute required (must be filled out) works with: text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file

maxlength

Input Restriction Input Attribute the maximum number of character for an input field Note: When a maxlength is set, the input field will not accept more than the specified number of characters. However, this attribute does not provide any feedback. So, if you want to alert the user, you must write JavaScript code.

max

Input Restriction Input Attribute the maximum value for an input field works with the following input types: number, range, date, datetime-local, month, time and week. Use the max and min attributes together to create a range of legal values

min

Input Restriction Input Attribute the minimum value for an input field works with the following input types: number, range, date, datetime-local, month, time and week. Use the max and min attributes together to create a range of legal values

HTML Input Type Attribute <input type="">

Specifies the input type to display

difference between the value attribute and the placeholder attribute?

The value attribute defines what "is in the input field". It's the input field's value. ... So if you pre-populate the value via the HTML attribute and then submit the form, that's the value that gets submitted back to your server. The placeholder is the value that shows up as long as the actual value is empty.

<input type="button">

a clickable button

<input type="datetime-local">

a date and time input field, with no time zone

<input type="file">

a file-select field and a "Browse" button for file uploads

<input type="hidden">

a hidden input field (not visible to a user). A hidden field let web developers include data that cannot be seen or modified by users when a form is submitted. A hidden field often stores what database record that needs to be updated when the form is submitted. Note: While the value is not displayed to the user in the page's content, it is visible (and can be edited) using any browser's developer tools or "View Source" functionality. Do not use hidden inputs as a form of security!

<input type="number">

a numeric input field. You can set restrictions on what numbers are accepted.

<input type="radio">

a radio button (for selecting only one of many choices)

<input type="reset">

a reset button that will reset all form values to their default values

<input type="text">

a single-line text input field

<input type="month">

allows the user to select a month and year. Depending on browser support, a date picker can show up in the input field

<input type="time">

allows the user to select a time (no time zone). Depending on browser support, a time picker can show up in the input field

<input type="week">

allows the user to select a week and year. Depending on browser support, a date picker can show up in the input field.

<input type="checkbox">

checkbox (for selecting zero or more of many choices)

form

collects user input, most often sent to server for processing

<input type="password">

defines a password field

<input type="range">

for entering a number whose exact value is not important (like a slider control). Default range is 0 to 100. However, you can set restrictions on what numbers are accepted with the min, max, and step attributes:

formnovalidate

form attribute The input formnovalidate attribute specifies that an <input> element should not be validated when submitted. Note: This attribute overrides the novalidate attribute of the <form> element . The formnovalidate attribute works with: submit.

formmethod

form attribute defines the HTTP method for sending form-data to the action URL. Note: This attribute overrides the method attribute of the <form> element. The formmethod attribute works with the following input types: submit and image. The form-data can be sent as URL variables (method="get") or as an HTTP post transaction (method="post").

formenctype

form attribute how the form-data should be encoded when submitted (only for forms with method="post"). Note: This attribute overrides the enctype attribute of the <form> element. The formenctype attribute works with: submit and image.

novalidate

form attribute none of the form-data should not be validated when submitted

formtarget

form attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form. Note: This attribute overrides the target attribute of the <form> element. The formtarget attribute works with the following input types: submit and image.

formaction

form attribute specifies the URL of the file that will process the input when the form is submitted. Note: This attribute overrides the action attribute of the <form> element. The formaction attribute works with: submit and image.

<input type="url">

input fields that should contain a URL address. Depending on browser support, the url field can be automatically validated when submitted. Some smartphones recognize the url type, and adds ".com"

<input type="color">

input fields that should contain a color. Depending on browser support, a color picker can show up in the input field

<input type="date">

input fields that should contain a date. Depending on browser support, a date picker can show up in the input field

<input type="tel">

input fields that should contain a telephone number

<input type="email">

input fields that should contain an e-mail address. Depending on browser support, the e-mail address can be automatically validated when submitted

<input type="submit">

submit button (for submitting the form)


Set pelajaran terkait

Russell Brandon General Psychology Exam 2

View Set

Consolidation Less than 100% Ownership

View Set

Chapter 6 - Small Business Entry: Paths to Entrepreneurship

View Set

Ch 6 Skeletal System Bone Tissue

View Set

NCLEX review questions IV therapy and blood Administration

View Set

Qualified Employer Retirement Plans

View Set