From is a necessary element in any website or blog. Mostly they are used to take user information for any of the purposes like logging into the user account, creating user account, allowing to subscribe malling list, allowing users to submit comments and allowing users to contact website admin, support or sales team.
Here I am going to describe "How to create a simple form using HTML" step by step with describing what is a form and what elements are used to create HTML form along with complete HTML code for a form.
A form is an area that contain form elements. You must set up a form before adding in run to the web page. To setup a form, you need to specify two important information Method and Action.
Method is a property tells the form how to transfer the data to the form processor. The value for method can be 'post' or 'get' In post method you are just posting information and method get means that you are just going to get another page. In almost all of the form post method is used.
Action property tells what action the form should take when the user presses the submit button. Action is the URL to which you are posting the information.
We have to use different HTML tags to create a form. The most commonly used HTML tags to create a form are listed below.
Tag: The most form tag is tag. The type of INPUT is specified with the TYPE attribute. This tag doesn't have its ending tag. The most commonly used INPUT types are listed below:
TEXT: It is used for plain type of text input. The attributes used in this type are NAME, VALUE, SIZE and MAXLENGTH.
Example:
PASSWORD: It is used for password type of text input. The attributes used in this type are NAME, VALUE, SIZE and MAXLENGTH.
Example:
RADIO: It is used for single choice input system. The attributes used in this type are NAME, VALUE and CHECKED
Example:
CHECKBOX: It is used for multiple choice input system. The attributes used in this type are NAME and VALUE.
Here I am going to describe "How to create a simple form using HTML" step by step with describing what is a form and what elements are used to create HTML form along with complete HTML code for a form.
A form is an area that contain form elements. You must set up a form before adding in run to the web page. To setup a form, you need to specify two important information Method and Action.
Method is a property tells the form how to transfer the data to the form processor. The value for method can be 'post' or 'get' In post method you are just posting information and method get means that you are just going to get another page. In almost all of the form post method is used.
Action property tells what action the form should take when the user presses the submit button. Action is the URL to which you are posting the information.
We have to use different HTML tags to create a form. The most commonly used HTML tags to create a form are listed below.
Different Tags for HTML Form
Tag: The most form tag is tag. The type of INPUT is specified with the TYPE attribute. This tag doesn't have its ending tag. The most commonly used INPUT types are listed below:
TEXT: It is used for plain type of text input. The attributes used in this type are NAME, VALUE, SIZE and MAXLENGTH.
Example:
PASSWORD: It is used for password type of text input. The attributes used in this type are NAME, VALUE, SIZE and MAXLENGTH.
Example:
RADIO: It is used for single choice input system. The attributes used in this type are NAME, VALUE and CHECKED
Example:
CHECKBOX: It is used for multiple choice input system. The attributes used in this type are NAME and VALUE.
Example:
RESET: It is used to reset values entered in a form. Value is the attribute of RESET type of INPUT.
Example:
SUBMIT: It is used to submit values entered in a form. Value is the attribute of SUBMIT type of INPUT.
Example:
This tag is used to specify the area of the text. This tag makes a two dimensional text area, in which viewer can type from a short sentence to many paragraphs. This tag has its ending tag and it is mostly used to create comment form or contact form. The attributes in this tag are NAME, VALUE, COLS and ROWS.
Example:
This tag is used to create a menu that offers visitors a list of option to choose from. This tab has also its ending tag. The attributes in this tag are NAME, MULTIPLE and SIZE.
Example:
It is the mini tag of
Subscription Form Subscription Form