Creating Electronic Forms
Following the body tag every form should begin with:
Followed by:
Text 1: Form element 1
Text 2: Form element 2
Text last: Form element last
(The Form elements should be chosen from below)
The form should end with:
<INPUT TYPE="submit" >
<INPUT TYPE="reset" >
</FORM>
Form Elements
What You Write in HTML
What You Get
Comments
<INPUT TYPE="text" NAME="whatever you want" SIZE=20 >
Note1
<INPUT TYPE="hidden" NAME="whatever " value="secret" >
Note1a
<INPUT TYPE="number" NAME="whatever you want2" SIZE=15 >
Note 2
<INPUT TYPE="checkbox" NAME="check" >
Note3
<INPUT TYPE="checkbox" NAME="check" value="words">
Note3a
<INPUT TYPE="checkbox" NAME="checkcheck" CHECKED>
Note4
<SELECT NAME="pop"> <OPTION> option1 <OPTION> option2 <OPTION> option:etc. </SELECT>
option1
option2
option:etc.
Note5
<SELECT NAME="scroll" size=2> <OPTION> option1 <OPTION> option2 <OPTION> option:etc. </SELECT>
option1
option2
option:etc.
Note5
<TEXTAREA NAME="large" ROWS=5 COLS=15></TEXTAREA>
Note6
<TEXTAREA NAME="largeWrap" wrap="physicel"ROWS=5 COLS=15></TEXTAREA>
Note6a
<INPUT TYPE="radio" NAME="radio" VALUE="whatamI" >
Note7
<INPUT TYPE="radio" NAME="radio" VALUE="meto" CHECKED>
Note8
<INPUT TYPE="password" NAME="pass" VALUE="" >
Note9
<INPUT TYPE="reset" VALUE="Clear it">
Note10
<INPUT TYPE="submit" VALUE="Doit" >
Note11
Note12
|
Get More Info Here
|
|
Carl's Page
|
Send questions about this page to
Carl Adler
Note1:
Change the size by changing the value in size="value". If you want it to have a default value ,follow the size statement by value="default".
BACK
Note1a:
Hidden form elements are very useful either in comunicating needed parameters to a
cgi
or simply to hide information from the user.
BACK
Note2:
A number such as a GPA can either be "text" or "number". If it is entered into a number form field which is then entered into a number field in a database, it can be numerically evaluated, e.g., you can calculate max,min,etc.
BACK
Note3:
Checkboxes (without a value specified) should have distinct names so that you can tell which if any is selected when the data are returned to you. The information you will receive will be that a button of a specified name is "on".
BACK
Note3a:
If you give a set of checkboxes the same name but different values and one or more are selected you will receive back the values of each one that was selected.
BACK
Note4:
You can elect to have one or more of a family (that is, the same name) preselected. This distinguishes them from radio buttons (covered below).
BACK
Note5:
You can add as many options as you want also you can preselect any of the options in either select element by using the word "selected" in the option list as in:
option1
option2
option,etc.
Sometimes you want to hide from the user the actual value of the options this can be done as follows:
option1
option2
option,etc.
When the visitor selects "option2" the word "choice2" will be sent to you.
BACK
Note6:
You can change the number of rows and columns.
BACK
Note6a:
To see the effect of the wrap command note that both boxes below have the same text typed into them.
To be or not to be that is the question.
To be or not to be that is the question.
BACK
Note7:
All radio buttons in a family must have the same name. The value of the selected one will be returned to you. If a value is not given for a button and a user selects it you will be told that button "the button name" is on. This is OK if you have only one button in the family. If you have more than one, however, you will not know which was selected.
BACK
Note8:
Only one button in a family can be preselected. Try clicking on the button above this one, which is in the same family.
BACK
Note9:
Try typing in this field.
BACK
Note10:
This clears the form. The only thing you can change here is the displayed name in the value statement.
BACK
Note12:
This is a JavaScript button which will run JavaScript functions when clicked. Try it. . Also try this (BUT answer NO when you are asked if you really want to close the window):
Learn more here
BACK