Académique Documents
Professionnel Documents
Culture Documents
Text fields:
Every form will have input fields. Use the <input> tag to
create input fields with following attributes.
Type : text, radio checkbox, password, submit and reset
Name: Assign a name to the given field.
Size: Set the width of the field
Maxlength: maximum number of char. That can be entered.
<form>
First name: <input type="text" name="first_name" /><br>
Last name:<input type="text" name="last_name" />
<input type="submit" value="submit" />
</form>
Radio button:
Radio Buttons are used when only one option is required to be selected.
Value: value to be sent to server.
Name : defines name of control.
<form>
<input type="radio" name="subject" value="maths" /> Maths
<input type="radio" name="subject" value="physics" /> Physics
<input type="submit" value="Select Subject" />
</form>
checkbox
Checkboxes are used when more than one option is
required to be selected.
<form>
<input type="checkbox" name="maths" value="on"> Maths
<input type="checkbox" name="physics" value="on"> Physics
<input type="submit" value="Select Subject" />
</form>
<form>
<select name="dropdown">
<option value="Maths" selected>Maths</option>
<option value="Physics">Physics</option>
</select>
<input type="submit" value="Submit" />
</form>
Creating Button:
There are various ways in HTML to create clickable
buttons. You can create clickable button using <input>
tag.
submit: This creates a button that automatically
submits a form.
reset: This creates a button that automatically resets
form controls to their initial values.
button: This creates a button that is used to trigger a
client-side script when the user clicks that button.
<form>
<input type="submit" name="Submit" value="Submit"
/><br /><br />
<input type="reset" value="Reset" />
<input type="button" value="Button" />
</form>
</form>