Forms in HTML and programming
HTML and JavaScript can build a basic web application with the components of forms.
Forms are graphical interface objects with data management recognized by all browsers.
The use of style sheets to give form to the look of a document written with field-aligned, colors, etc.
See this introduction to know how to create and use HTML forms, with examples.
The list of all form objects in HTML 4.01 and how use them. The demonstration of form objects shows how data are transmitted for each.
View also the HTML 4 specification.
HTML 5 adds new components
HTML 5 is not yet a standard, but it may be interesting to see the new items he proposes for the forms, as it is designed for Web applications.
Input
This generic item has several types in HTML 4 (button, submit), but in version 5 it add a whole collection. Including:
* Number: a numerical value.
* Date: to enter a date.
* Telephone: a telephone number.
* Color: a table to select a color
* File upload: to upload files. The types can be specified (video, image ...).
menu
More comprehensive than select in HTML 4, it can easily create a menu or a toolbar with images.
dataList
Returns a list of selected elements. Near select.
output
Displays the result of a calculation.
datagrid
Represents a tree or an interactive table. The content can change easily.
See HTML 5.
Form data are accessed client-side or server-side
Access to data in JavaScript can add controls on the content entered by the user, and process the data in the page with Ajax.
Data can also be used directly on the server by a script if its file name is assigned to the action attribute.
Use the data in another page:
- Sending and receiving form data is explained for all objects.
- How to pass parameters to a webpage. Using the data of a form in another page.
And all that allow to create a user interface in HTML...
Objects of forms are sufficiently varied to create a graphical user interface for a web application.
However it is common to use an Ajax framework to have more widgets. In fact HTML with JavaScript and CSS would be sufficient to create all the interface elements but using frameworks helps to avoid repeating what has already been done.
We can without framework create for example a TabPanel (a group of tabbed panels). It is a form object shaped graphically by a stylesheet.
The other components of interfaces: toolbars, menus, windows, radio buttons and others are so easily definable from form objects.
| Tweet |
|