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..

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

<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 />

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

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

<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:
  <option value="ram">Ram</option>
  <option value="shyam">Shyam</option>
  <option value="atul">Atul</option>
  <option value="mohan">Mohan</option>
</select>  <br />

  Name: <input type="text"><br>
  Email: <input type="text"><br>
  Date of birth: <input type="text">

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 | Privacy Policy | Contact Us