HTML Input Examples

HTML form use to get information about user and information store that data into a web server.

Textbox field

<html>
<body>
  <form action="form_submit.php" method="post">
    First name:
    <input type="text" name="FirstName:" size="10" maxlength="15" />
    <br />
    Last name:
    <input type="text" name="LastName:" size="10" maxlength="15" />
  </form>
</body>
</html>

First name:

Last name:

Password field

<html>
<body>
  <form action="form_submit.php" method="post">
    Password:
    <input type="password" name="Password" size="15" maxlength="15"/>
  </form>
</body>
</html>

Password:

Radio field

<html>
<body>
  <form action="form_submit.php" method="post">
    Que. What is your favourites Web browser.
    <input type="radio" name="browser" value="IE8" /> Internet Explorer 8 <br />
    <input type="radio" name="browser" value="GC" /> Google Crome <br />
    <input type="radio" name="browser" value="FX"  /> Mozila Firefox
  </form>
</body>
</html>

Que. What is your favourites Web browser
Internet Explorer 8
Google Crome
Mozila Firefox

Checkbox field

<html>
<body>
  <form action="form_submit.php" method="post">
    Que. Select your hobby.
      <input type="checkbox" name="cricket" value="cricket" /> Cricket <br />
      <input type="checkbox" name="watchtv" value="watchtv" /> Watch Tv <br />
      <input type="checkbox" name="playgame" value="playgame" /> Play Game <br />
      <input type="checkbox" name="inserf" value="inserf" /> Internet Surfing
  </form>
</body>
</html>

Que. Select your hobby
Cricket
Watch TV
Play Game
Reading
Internet Surfing

Button field

<html>
<body>
  <form action="form_submit.php" method="post">
    Name:
    <input type="text" name="name" size="15" maxlength="15" />
    <br />
    <input type="submit" value="submit" name="Submit" />
    <input type="reset" value="reset" name="Reset" />
  </form>
</body>
</html>

Name:

<textarea> tag

It is used to specify a texts are or multi line textbox. In a textarea you can write an unlimited character. It is mostly use in user feedback, home address etc.

<html>
<body>
  <form action="form_submit.php" method="post">
    Your Feedback: <br />
    <textarea cols="65" rows="4" name="Feedback" >
      I realy like your Web Service because....
    </textarea>
  </form>
</body>
</html>

Your Feedback:

Selection list fields

<html>
<body>
  <form action="form_submit.php" method="post">
    Select Your Hobby: <br />
    <select name="hobby" >
      <option value="cricket">Cricket</option>
      <option value="WatchTV">Watch Tv</option>
      <option value="PlayGame">Play Game</option>
      <option value="Reading">Reading</option>
      <option value="Int">Internet Surfing</option>
    </select>
  </form>
</body>
</html>

Select Your Hobby: