HTML is a web page markup language which designs your static web pages.The most common thing we see in a web page is a form.We normally
signup for various services, comments on articles, discussion forum, polls and many other services.These all are a type of form which one can easily
create using the HTML "form" tag.HTML forms are used to collect different kinds of user input.
A form is an area that can contain form elements.
Form elements are elements that allow the user to enter information in a form (like text fields, text area fields, drop-down menus, radio buttons, check
boxes, and so on). But HTML forms are only static.Means they can send the information but can't check whether the information is valid or not.
To implement the form validation, you'll have to use a scripting language such as javascript, vbscript, php etc.Form validation is an important thing but
form structure is another important thing which we can do using HTML only.
form and input Tags
form tag is used to declare a form in which we can place elements which will let the users to input their information.Format
....input elements.... </form>
"input" tag is used to create different elements.In this article we'll only focus on text fields.For other type elements see our type of html form elements article.
Now we'll discuss the form we created above.
- The first thing is :- declare the form using the "form" tag.
- Then create input field by using the "input" attribute.This goes like this...."input type='__' name='__' value='__'"
- After creating desirable number of fields, close the form tag by "/form".
In the name attribute, set the name of the field, which is "Name" in our case i.e. "name=Name".
In the value attribute, set the value to be displayed in the field which you can further edit while filling a form
- Form attributes and methods
- Types of forms or input elements
Comments
Post a Comment
Comment on articles for more info.