We'll see what a form is, why it's used, how to insert one, which elements it can contain, and how to validate the data introduced into it. |
Forms are used to get users data, they can also be used to make orders in a virtual store, to create a survey, to know users opinon, receiving questions, etc. Once the user has filled out the data and clicked the button to send the form, a program will start, and will receive the data and make the required treatment. Here, we're going to see how to create a form (insert fields and buttons into the form and validate them) but not the data treatment yet, because you need programming knowledge, like VBScript, JavaScript or other programming language and this part isn't in the objective of the course. On the right you have an example of a form. A form can have labels, text fields, drop-down menus, and buttons. | |
You can create forms through the Insert menu and then the Form option. Once you have created the form, it will be represented in the Dreamweaver window as a box with dashed red lines, similar to this image on the right side. You can insert the form elements inside the form through the Insert menu and then the Form option. |
It's recommendable to use tables to organize the elements of the forms. You will find a better distribution of the form elements using them, and this will make its comprehension easier while improving its appearance. |
The forms validation is used to make the form valid before sending it, and also to make the user fill in the obligatory fields before sending it. To validate a form, you need to open the Behaviors panel. This panel can be opened through the Window menu and then the Behaviors option, or by pressing Shift+F3. In this panel you need to unfold the button by clicking on it, and in Show events for, select an actual version from the browser's list. You can choose for example IE 6.0. browser. After doing this, you have to unfold the button again, and select the Valid form option. For all this you will have to previously select the form. |
A window like this will be shown, here you will find all the form elements. You can select each one of the form element, and specify the required requests. You can establish an obligatory filling field, whether it's content to be numeric, an e-mail address, etc. |
0 komentar:
Posting Komentar