Forms 102
Constructing a form is far less intimidating than it may appear at first. If you've already set up web pages using HTML, then you'll move naturally into setting up forms, which are also written using tags embedded right in an ordinary page. As with all other HTML, the appearance of a form can be dramatically altered by the browser used to view it. A great way to learn Forms, as with other HTML, is to examine the work of others: feel free to look at the source of these tutorials, or that of any other forms you are impressed by. Here's the source HTML for the above form:
< FORM METHOD=POST ACTION="http://hoohoo.ncsa.uiuc.edu/htbin-post/post-query" >
Let's take a close look at each of the elements of this form. The FORM tag - Opening and Closing a Form <FORM METHOD=POST ACTION="[name of program]"></FORM> These tags start and end a form (all input fields of the form are placed between these tags). METHOD specifies which technical protocol the web server will use to pass the form data to the program which processes it (always set it to POST), and ACTION tells the server exactly which program that is. Note: POST must be capitalized, otherwise the method defaults to "GET". In our example, the action is a program called post-query on an NCSA server. The post-query program is one NCSA supplies for testing forms. It simply echoes back the names and contents of all input fields on a form submitted to it. A web page may include multiple forms; however, forms may not be nested (you cannot create a form within a form). You must end the current form with </FORM> before you can start a new one. Getting a line of text from the user Enter your name: <INPUT NAME=your_name>
The Submit Button <INPUT TYPE=submit VALUE="Test this form"> Each form must have exactly one field of type submit. This creates the button the user pushes when they're done filling out a form, and should come after all the other input fields. If a form doesn't have a submit button, it is useless since once the user finishes typing in the data they won't have any way of sending it to a server. You can put whatever words you like on the submit button, using the VALUE keyword. If you omit the VALUE keyword, the button will be labeled "Submit". When the user clicks the submit button, the browser collects the values of each of the input fields (text typed by the user, etc.) and sends them to the web server identified in the ACTION keyword of the FORM open tag (and that web server passes that data to the program identified in the ACTION, using the METHOD specified).
Continue With Other Forms Tags |
||
|
Register domain names at: |
||
|
The Internet Brothers have implemented
hierarchical menus for navigation. Easier done than said.
The hierarchical
menus were created using Peter Belesis' © Dynomat DHTML
scripting tool
from Webreference. Give them a visit, you'll like
what you learn.
I'm a light eater. As soon as it's light I start to eat.
I turned my life around. I used to be depressed and miserable. Now I'm miserable and depressed.
Stress is when your mouth says "yes" and your gut says "no".
|
Copyright © 1997-present Internet Brothers. All Rights Reserved. Really.