FORMS
FORMS
Course :BCA
Semester :4th
Subject : WD
Faculty: Ms. MONIKA AGGARWAL
Topic :FORMS IN HTML
HTML Forms
The <input
type="radio"> defines a radio
button.
Radio buttons let a user select
ONE of a limited number of
choices.
Example
<form>
<input type="radio" id="male" name="gender" value="male"
<label for="male">Male</label><br>
<input type="radio" id="female" name="gender" value="fem
le">
<label for="female">Female</label><br>
<input type="radio" id="other" name="gender" value="othe
>
<label for="other">Other</label>
</form>
CONT..
This is how the HTML code above will be
displayed in a browser:
o Male
o Female
o Other
Checkboxes
The <input
type="checkbox"> defines
a checkbox.
Checkboxes let a user select
ZERO or MORE options of a
limited number of choices.
Example
<form>
I have a bike
I have a car
I have a boat
The Submit Button
The <input type="submit"> defines a button
for submitting the form data to a form-
handler.
The form-handler is typically a file on the
server with a script for processing input data.
The form-handler is specified in the
form's action attribute.
Example
<form action="/action_page.php">
</form>
The <select> Element
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
The <textarea> Element
Example
<label for="username">Username:</label><br>
<label for="pwd">Password:</label><br>
</form>
CONT..
<form action="/action_page.php">
</form>
CONT..
<form action="/action_page.php">
<input type="reset">
CONT..
<form>
<label for="male">Male</label><br>
<label for="female">Female</label><br>
<label for="other">Other</label>
</form>
CONT..