To begin your form you will need the: <form> This tag always includes a few other tags that tell the server how to process the form. The action Attribute tells the browser where to send the form. The Method tells the browser how to send the form. Here you can use either POST or GET. <form action="URL" Method=post> You need to specify where to send the results: This is where you need to get the correct code from your own ISP provider, or free web page provider. <Input type=hidden name=from your isp Value="youremail address">
To use text boxes where people will type ininformation: <input type=TEXT Name="field name"> The field name is what you assign to the field that is unique among the other fields in the form. For example the first field will be the persons first name: First Name: <input type=TEXT Name="first"> Last Name: <input type=TEXT Name="first"> and your form will look like this:
First Name: Last Name:
You can change the size of the box by using the size attribute: First Name: <input type=TEXT Name="first" size =15> First Name:
Always good to add in the Maximum length attribute. This makes it so they cannot add any more words after a certain amount depending on what you specify. First Name: <input type=TEXT Name="first" size =15 maxlength=25> First Name:
You can also make it a required field, meaning the person filling out the form must enter into that field or the form will give them an error message: First Name: (required) <input type=REQUIRED:TEXT Name="first" size=15>
You can also add a value to the field, which will have pre defined words URL: <input type=TEXT Name="url" size =25 maxlength=50 value ="http://"> URL:
For a text area for people to add comments use this code: <TEXTAREA Name="comments" rows=5 cols=20> </textarea> Enter your comments here:
To use check boxes where people can select thier choices: <Input Type=CHECKBOX name="field name"> My favorite fruit is: Apples: Oranges:
Or use radio buttons: <Input Type=RADIO name="field name"> My favorite fruit is: Apples: Oranges:
There are also lists that you can select from. The size attribute is for how many item numbers in the list you want the browser to display. You can display them all or just display only one item. If the size is 2 or more it will become a scroll bar for navigating choices. You can also use the MULTIPLE attribute in the select tag so they can select one or more items. <select name="field name" size=Items to display> <OPTION> Apples</OPTION> <OPTION> Oranges</OPTION> </SELECT>
This is using the size of 1: Apples Oranges Pears Peaches
This is using the size of 4: Apples Oranges Pears Peaches
To add the MULTIPLE attribute: <select name="list3" size=4 Multiple> <OPTION> Apples </OPTION> <OPTION> Oranges </OPTION> <OPTION> Pears </OPTION> <OPTION> Peaches </OPTION> </select>
Here you can select one or more items: Hold down the control key to select more than one item. Apples Oranges Pears Peaches
Now you need the submit or reset Buttons so the form will be sent. The Value attribute can be changed to what ever you want the button to say <Input type=SUBMIT value="Submit"> <Input type=RESET value="reset">
Finally you need the closing form tag: </form>
You can have the form go to another page that says the form has been submitted or a thank you for filling out the form. This is another code you will need to get from your ISP or free web page service as this differs from server to server depending on the CGI script it uses. it is generally something like this: <input type="hidden" name="resulturl" value="filename.html"> This code needs to go before the ending form tag.
Back to Top
This page was last updated 05/11/2003