![]() |
![]() |
![]() |
![]() |
![]() |
||||
This is about creating forms. They were intended for server side processing of user input. They can, however, be used with Java Script to deal with user input. In this set of lessons we will look at how to use the basic building blocks of forms which we can use later with Java Script.
The ACTION for the form is an URL, usually one that starts a server based program (cgi script), but it can refer to any file. There are two METHODS, POST and GET, which is also the default.
<form ACTION="index.htm" METHOD="GET"></form>
If this form has a submit button, then pressing the button will open the URL index.htm. The following form has a text box and a reset button. Inside the form there is a text area with scroll bars. Try changing the text in the text box or the text area, or in both, and pressing the reset button to see what happens.
The following buttons are RESET buttons within forms (actually three forms.) Press them and see what happens.
To learn how to make these buttons go to Buttons in Forms (or press the 'Buttons in Forms' button!!!)
The following code, included within the form tags, of course, generates the box below.
<input type="text" NAME="tb1" VALUE="This is an input type="text"" SIZE="50">
Note that the VALUE is the text which is displayed, and the SIZE is the maximum number of characters displayed. However, the user can enter as many characters as he or she likes. The '"' special character is used to make the quotation marks. If ordinary ones were used, the browser would get confused (poor thing.)
Unlike the 'input type is text', the text area can have more than one line, and may have more than the stated number of rows of text, in which case, scroll bars will be displayed. The code and the text area are shown below:
<form><textarea rows="5" name="S1" cols="30">This is a text area.</textarea></form>
The COLS attribute gives the maximum number of characters displayed in a line, and the ROWS attribute gives the number of lines displayed. There can, as mentioned be more than the stated number of rows, and these will be visible to the user by scrolling. The example text area has only one line, and 5 rows are shown. See the example on the buttons page of a text area used to neatly show a long list of options. Its intended function, however, is to act as an imput for information to be sent to the server.
| HTML: The Definitive Guide by Chuck Musciano, Bill Kennedy, Mike Loukides (Editor) Packed with examples, this book will take you on to be an HTML expert. Beginners who wish to be proficient, and experienced users, especially, will find this book helpful. It is an up-to-date coverage of the language and give information on good style, and good presentations for various purposes. Click the picture to order or get further information from Amazon.com Or from Amazon.co.uk for Europe. |
![]() |
Let's look at buttons in forms, now!
[contents][back to: hyperlinks in frames][Next: Buttons in Forms]
[Menus in Forms][on to: Meta Tags] [Home Page]
Most Recent Revision: 18-Oct-98.
Copyright © 1998 Ken J
Ward
I am always pleased to hear from you.
Send your comments to Ken
Ward
and please visit: The New Life Course