Back

Forms







If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".

Radio Buttons

Choose your favorite Web language:




Checkboxes



The Action Attribute






If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".

The Target Attribute

The form target attribute

When submitting this form, the result will be opened in a new browser tab:






The Method Attribute

This form will be submitted using the GET method:






After you submit, notice that the form values is visible in the address bar of the new browser tab.

This form will be submitted using the POST method:






After you submit, notice that, unlike the GET method, the form values is NOT visible in the address bar of the new browser tab.

The Autocomplete Attribute

The form autocomplete attribute

Fill in and submit the form, then reload the page, start to fill in the form again - and see how autocomplete works.

Then, try to set autocomplete to "off".





The Novalidate Attribute

The novalidate attribute indicates that the form input is not to be validated on submit:



The <input>Element




The <select>Element

The select element defines a drop-down list:

The select element defines a drop-down list:

Visible Values:

Use the size attribute to specify the number of visible values.



Allow Multiple Selections:

Use the multiple attribute to allow the user to select more than one value.



Hold down the Ctrl (windows) / Command (Mac) button to select multiple options.

The <textarea> Element

Textarea

The textarea element defines a multi-line input field.

Comment:


Styling Textarea

Use CSS to change the size of the textarea:


The <button>Element

The button Element

The
and Elements

Grouping Form Data with Fieldset

The fieldset element is used to group related data in a form, and the legend element defines a caption for the fieldset element.

Personalia:




The Element

The datalist Element

The datalist element specifies a list of pre-defined options for an input element.

The Element

The output Element

The output element represents the result of a calculation.

0 100 + =