A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.) in a form. A form is defined with the form in opening and closing carrots. Like this: <form>
The most used form tag is the input tag. The type of input is specified with the type attribute. The most commonly used input types are explained below.
Text fields are used when you want the user to type letters, numbers, etc. in a form.
It looks like this:<form> <input type="text" name="firstname" />
Same thing for the last name:
<form> <input type="radio" name="lastname" />
First name:
Last name:
Radio Buttons are used when you want the user to select one of a limited number of choices. The code looks like this: <form> <input type="radio" name="sex" value="male" /> Same thing for the female: <form> <input type="radio" name="sex" value="female" /> Then this is how it shows up:
Checkboxes are used when you want the user to select one or more options of a limited number of choices. It looks like this: <input type="checkbox" name="vehicle" value="Bike" /< Then you just switch "car" and "airplane" into the value.
When the user clicks on the "Submit" button, the content of the form is sent to the server. The form's action attribute defines the name of the file to send the content to. The file defined in the action attribute usually does something with the received input. The code looks like this: <form name="input" action="html_form_submit.asp" method="get">
If you type some characters in the text field above, and click the "Submit" button, the browser will send your input to a page called "html_form_submit.asp". The page will show you the received input.