Form and their attributes in HTML




Asked on February 26, 2015
how to create a form in html? can anyone help..


Replied on February 26, 2015
Hi Jonam, you can create a form in HTML using <form> tag. Check the form and attributes one by one..

<body>
<form action="" method="get">
Name:
<input name="Name" type="text" value="" size="10" maxlength="10" align="middle"/></form> <br />

Password:
<input name="" type="password" value="" size="10" maxlength="10" /> <br />

Radio Button:
<input name="Radiao" type="radio" value="" /> <br />

Radio Button Checked:
<input name="radio" type="radio" value="" checked /> <br />

Checkbox:
<input name="CheckBox" type="checkbox" value=""  />  <br />

Text Area:
<textarea name="TextArea" cols="20" rows="3"></textarea> <br />

Button:
<input name="button" type="button" value="Button" />   <br />

Submit Button:
<input name="Submit" type="submit" value="Submit " />  <br />

Reset Button:
<input name="Reset" type="reset" value="Reset" /> <br />

Drop Down List:
<select>
  <option value="ram">Ram</option>
  <option value="shyam">Shyam</option>
  <option value="atul">Atul</option>
  <option value="mohan">Mohan</option>
</select>  <br />

Fieldset:
<fieldset>
  <legend>Information:</legend>
  Name: <input type="text"><br>
  Email: <input type="text"><br>
  Date of birth: <input type="text">
 </fieldset>
</form>
</body>





Replied on February 26, 2015
The role of <form> in HTML is sending data to server using different methods like GET, POST etc. There can be more than one <form> in HTML body. Give them different id and name or they will be accessed as an array if same name or id. 

Write Answer










©2024 concretepage.com | Privacy Policy | Contact Us