HTML Forms
11 - Oct - 2021
XpertPhp
25
The HTML Forms elements are many types of input elements like text field, password field, checkbox, radio button, submit button, etc.
The <input> Element
The <input> Element used for HTML form. it is depending on the type attribute. because many types of values are available in the input element. like text field, password field, checkbox, radio button, submit button, etc.Text Field
Example<input type="text" id="txtUname" name="txtUname" />
Textarea Field
Example<textarea name="address" rows="10" cols="15"></textarea>
Password Field
Example<input type="password" id="txtPass" name="txtPass" />
Checkbox
Example<label for="chkred">Red</label> <input type="checkbox" name="chkred" id="chkred"> <label for="chkgreen">Green</label> <input type="checkbox" name="chkgreen" id="chkgreen"> <label for="chkyellow">Yellow</label> <input type="checkbox" name="chkyellow" id="chkyellow">
Radio Button
Example<label for="male">Male</label> <input type="radio" name="gender" id="male"> <label for="female">Female</label> <input type="radio" name="gender" id="female">
Submit Button
Example<input type="submit" value="Submit" />