HTML Forms

83 views

While almost all other elements in HTML are for controlling the display and presentation, HTML FORM and INPUT tags add interactivity to the web site. The HTML forms handle very important operations at the website like taking orders, surveys, user registration and so on. You will hardly find a single web site without forms.

<form>

<input>

</input>

</form>

Input Type

The most used form tag is the <input> tag. The type of input is specified with the type attribute. The most commonly used input types are explained below.

<form>

Firstname

<input type=”text” name=”firstname”>

<br>

Second name

<input type=”text” name=”secondname”>

</form>

Radio Buttons are used you want the user to select one of a limited number of choices.

<form>

<input type=”radio” name=”sex” value=”male”>male<br>

<input type=”radio” name=”sex” value=”female”>female

</form>

Checkboxes are used  you want the user to select one or more options of a limited number of choices.

 <form>

<input type=”cheakbox” name=”city” value=”delhi”>Delhi<br/>

<input type=”cheakbox” name=”city” value=”mumbai”>Mumbai<br/>

</form>

the user clicks on the “Submit” button. The file defined in the action attribute usually does something with the received input.

 <form action=”text.html” method=”post”>
  <input type=”text” name=”"> <input type=”submit” name=”submit” value=”submit”>
  </form>



« HTML Lists Lesson 3. Variables in javascript »
Posted on Wednesday, June 18th, 2008 at 5:38 pm under HTML for Beginners | RSS 2.0 Feed

Post Comment

You must be logged in to post a comment.



ComputerEducationWorld.com All Rights Reserved © RSS | CBSE | Education Boards Of India | What is My IP?