Monday, 22 April 2013

HTML Forms



HTML Forms

  • HTML forms are used to pass data to a server.
  • An HTML form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more.
  •  A form can also contain select lists, textarea, fieldset, legend, and label elements.

         The <form> tag is used to create an HTML form:
               <form>
                 .
                 input elements
                .
              </form>


  • The most important form element is the <input> element.
  • The <input> element is used to select user information.
  • An <input> element can vary in many ways, depending on the type attribute. An <input> element can be of type text field, checkbox, password, radio button, submit button, and more.
  • HTML forms are placed on a web page using the <form> tag.
  • This tag should encapsulate a series of other form elements, identifying them as a single cohesive web form.


Description


  • HTML web forms are a composition of buttons, checkboxes, and text input fields embedded inside of HTML documents with one goal in mind: to capture user input.
  • By doing things such as providing fields for user data such as names, phone number, and email addresses, web forms give users the opportunity to interact directly with a webpage.
  • HTML form elements rely on action and method attributes to identify where to send the form data for processing (action) and how to process the data (method).
  • In the code above, we've inserted some make-believe values to represent what a typical HTML form might look like behind the scenes.
  • Forms are usually combined with programs written in various programming languages to allow developers to create dynamic web sites.
  • The most popular languages include both client-side and/or server-side languages.
  • Although any programming language can be used on the server to process a form's data, the most commonly used languages are scripting languages, which tend to have stronger string handling functionality than programming languages such as C, and also have automatic memory management which helps to prevent buffer overrun attacks.


Example

<!DOCTYPE html>
<html>
<body>

<form action="">

<legend>Personal information:</legend>
Name: <input type="text" size="30"><br>
E-mail: <input type="text" size="30"><br>
Date of birth: <input type="text" size="10">

</form>
</body>
</html>


Display

Personal information:
 Name:
E-mail:
Date of birth:
VBottom of Form


0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More