http://ei.cs.vt.edu/cgi-bin/wwwbtb/SampleForm.pl?submit=Run+CommandGeneral form is
http://server/cgi-bin/script?name1=value&name2=value
Enter month:
This was created byEnter month: <INPUT NAME="month" TYPE=TEXT>
Some variations are possible. You can specify the text box size, the maximum number of characters a user can type and even giveit a default text value:
This was created by:Enter month: <INPUT NAME="month" TYPE=TEXT SIZE=4 VALUE="OCT">
One other variation is possible for password entry, where some character replaces the actual characters a user types:
This was created by:Enter password: <INPUT NAME="passwd" TYPE=PASSWORD SIZE=8>
Enter things to do: <TEXTAREA NAME="todo"></TEXTAREA>
Some variations are possible. You can specify the text area size and even give it a default text value:
This was created by
Note that the TEXTAREA tag is not an INPUT tag, but a tag of its own!Enter things to do: <TEXTAREA NAME="todo" ROWS=4 COLS=20> 1. Do CS6204 homework. 2. Play racketball. </TEXTAREA>
The Web browser will make all INPUT tags with type RADIO and matching NAME field (e.g., "day") into one set of radio buttons.Choose a day: Saturday <INPUT NAME="day" TYPE=RADIO VALUE="Saturday"> Sunday <INPUT NAME="day" TYPE=RADIO VALUE="Sunday">
Adding "CHECKED" to the above INPUT tag places a check in the checkbox by default:<INPUT NAME="email" TYPE=CHECKBOX VALUE="sendit"> Send e-mail reminder
Forms that contain multiple submit buttons use the NAME attribute to distinguish which was clicked: This is created by<INPUT TYPE=RESET VALUE="Clear the form">
The first case generates in the GET or POST send to the Web server<INPUT TYPE=SUBMIT NAME="submit" VALUE="Initate Local Search"> <INPUT TYPE=SUBMIT NAME="submit" VALUE="Initate World-wide Search">
submit=Initiate+Local+Search
<INPUT TYPE=IMAGE NAME="what_was_pressed" SRC="MapOfVirginia.gif">A GET or POST will contain the x,y coordinates of where the user clicked on the image.
<SELECT NAME="Day"> <OPTION>Saturday <OPTION>Sunday </SELECT>
<SELECT SIZE=2 MULTIPLE NAME="Day"> <OPTION>Thursday <OPTION>Friday <OPTION>Saturday <OPTION>Sunday </SELECT>
Return to CS6204 home page.
Last modified on 16 June 1997 by abrams@vt.edu.
[This is http://ei.cs.vt.edu/~wwwbtb/fall.96/ClassNotes/FormsScripts/forms.html.]