Skip to the content.
- The best Known form on the web is probably the search box that sits right in the middle of Google’s homepage.
- There are several types of form controls that you can use to collect information from visitors to your site.
- Adding Text: Text input, Password input, Text area
- Making Choices: Radio buttons, Checkboxes, Drop-down boxes
- Submitting Forms: Submit buttons, Image buttons, Uploading files
- A user fills in a form and then presses a button to submit the information to the server.
- The name of each form control is sent to the server along with the value the user enters or selects
- The sever processes the information using a programming language such as PHP, C#, VB.net, or Java.
- The server creates a new page to send back to the browser based on the information received.
- Form controls live inside a <Form> element.
- Every from element requires an action attribute.
Text Input
- The <input> element is used to create several different form controls.
- type=”text”; When the type attribute has a value of text, it creates a single-line text input.
- name
- maxlength
- type=”password”
- name
- size, maxlength
Text Area
- the <textarea> element is used to create a multi-line text input.
- type=”radio”
- name
- value
- checked
Checkbox
- type=”checkbox”
- name
- value
- checked
Drop-down List Box
- <select>
- name
- <option>
- value
- selected
Multiple Select Box
- <button>
- <input>
- type=”hidden”