![]() |
|
Forms collect information; they don’t do anything with it. A lovely script does all the clever stuff and I can't tell you how to write those but I'll tell you what I do know. To let a script process the information on a form, you need to add two attributes to the <form> tag. These are method and action. For example: <form method="post" action="script.cgi"> The action attribute is the address of the script that processes the information on the form. The method attribute describes how the browser sends the data to the server:
If you want to know anymore, you are on your own. The information is passed to the program in name-value pairs. The value is the information that the user enters and the name is the label that identifies the input. For example, your form has two inputs labelled name and email: <form> Enter your name and email address: <input type="text" name="name" size=30> <input type="text" name="email" size=60> </form> The user types Ann Gilliver for name and a.gilliver@lineone.net for email. The form passes the information to the program. The labels corresponds to the variable names in the program and the information that the user enters is the value for the variable. This means that each input must have a unique name attribute. The program can do what it likes with the information but it will probably e-mail the user with further information. |
More information Setting up the tab order of fields Process the information in the form |