HTML Form

By | January 8, 2020

A web page has a form, HTML gives us the facility to create the form, in a HTML form, we can add names, data, addresses etc. HTML gives us many such fields in the form in which we can add our fields and that data has to be sent where it goes. To collect data from site visitors, we need HTML form. For example, if someone wants to buy some items from a used site, then he has to fill the form to give his address. Which HTML gives us this facility. A form has many elements such as input, textarea, submit button, using which one can submit his form. Before starting any element in HTML, it has a special tag, in the same way the form also has a start tag and an end tag.

Example:-

<form></form>

The form has a start tag <form> and end tag </form>.

<form>
	<label>Enter Name</label>
	<input type="text">
</form>

Output:-

form

HTML provides us the input whose type can be changed and we can have our data in it.

Such as input type text, input type password, input type radio

Input Type Text:-

<form>
	<label>First Name</label>
	<input type="text">
	<label>Last Name</label>
	<input type="text">
</form>

Output:-

form

Input Type Radio Buttons:-

<form>
	<label for="male">Male</label>
	<input type="radio" name="gender" id="male">
	<label for="female">Female</label>	
	<input type="radio" name="female" id="female">
</form>

Output:-

form

Input Type Password:-

<form>
	<label>Password</label>
	<input type="password">
</form>

Other input types :-

<form>
<input type="radio">
<input type="button">
<input type="date">
<input type="color">
<input type="email">
<input type="hidden">
<input type="range">
<input type="search">
<input type="submit">
<input type="tel">
<input type="text">
<input type="time">
<input type="url">
<input type="month">
<input type="checkbox">
<input type="image">
<input type="reset">
<input type="week">
<input type="password">
</form>

You can select these inputs.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *