..


Sponsored Links

The Forms (forms)

'S HTML provides a number of interesting tags whose purpose is to create forms with lots of text boxes, options, submit buttons, and more.

The technical term that sums up all these elements and forms and their purpose is to create interaction and data exchange between users and the site.

HTML forms allow only the realization of the interface module, but by themselves do not offer the least control and minimal management on the data.

Let us now understand how to create complete forms, such as tags and elements in general are involved and what their specific characteristics.

To create a form using the form tags of the same name, as in the following:






 <form method="" action="">









 </ Form>



The main attributes, as seen in the example are as follows:
  • method - specifies the method of delivery of data and takes the values ​​with get or post;
  • Action - specifies the script that will receive, check and process data.
Let us now review the individual tags that generate HTML form elements:
  • input - generate most of the elements of the HTML form, depending on the type specified;
  • select - creates a scrolling list box, the colloquial name selectbox;
  • textarea - creates a text area where you can go to the head and is used to allow you to enter descriptions, comments, or however long texts.
We see a complete example of HTML form:





 <form method="post" action="esegui.asp">







 Name <br>







 <input type="text" name="nome"> <br>







 Surname <br>







 <input type="text" name="cognome"> <br>







 Country <br>







 <select name="paese">







 <option value="I"> Italy </ option>







 <option value="E"> International </ option>







 </ Select> <br>







 Sex <br>







 <input type="radio" name="sesso" value="M"> M <br>







 <input type="radio" name="sesso" value="F"> <br> F







 Hobbies <br>







 <input type="checkbox" name="hobby" value="S"> <br> Sports







 <input type="checkbox" name="hobby" value="L"> Reading <br>







 <input type="checkbox" name="hobby" value="C"> Cinema <br>







 <input type="checkbox" name="hobby" value="I"> Internet <br>







 Comment <br>







 <textarea name="commento" rows="5" cols="30"> </ textarea>







 <br>







 <input type="submit" name="invia" value="Invia the dati">







 </ Form>



The result is as follows:

So let's see what are the characteristics and attributes of the most important elements of the HTML form:

  • text boxes - allows you to enter short texts and to set the type is text;
  • selectbox - allow you to select from a list the desired value;
  • radiobutton - used to select one and only one option for the group and the type is set by radio;
  • checkbox - used to select one or more options for the group and the type is set to checkbox;
  • textarea - allows you to insert long texts and set the height (rows) and width (cols) of the area;
  • submit buttons - let you send data, specifying the type or submit button.
Each element of the HTML form has a characteristic in common, namely that the specific name must be different from element to element and equal only for groups of elements, as in the case of radio buttons and checkboxes that ask the same type of data.

The value attribute sets the default value of the individual elements.

HTML Help
E-Learning
CSS (Course) CSS (Course)
Web Design and Accessibility according to W3C CSS and XHTML. Starting from 29 €.
HTML (Course) HTML (Course)
The markup language for the Web from 29 €.
Web Design (Course) Web Design (Course)
Design Web Sites with HTML, CSS and Dynamic HTML. From 39 €.
Sponsored Links