465 -- Introduction to Forms

1. There are three main ways for web users and authors to communicate with each other


2. The Form tag, <FORM> ... </FORM>, can go anywhere in an HTML document. There can be multiple forms in the same document, and each Form uses normal HTML code to format its appearance. TABLES are often used to line up and group elements in the FORM. See Castro, Chapter 11, pp. 187-192


3.Borrow and adapt an existing form.

Since writing CGI scripts is a steep undertaking -- and your system may not support your efforts for security reasons -- you can find a working Form on your system and adapt the elements to your own use. Rutgers systems such as Pegasus are not hospitable to new CGI scripts.

In adapting an existing CGI-scripted FORM, you must change several things:


4. Creating your own CGI form from scratch -- not recommended. In its simplest stage, a Form for CGI requires only a few elements, and here we discuss only the most typical:


5. Alternate Method: Creating your own email form from scratch. In its simplest stage, a Form for email requires even fewer elements, and here we discuss only the most typical:

Here's A old working example combining CGI and email in the ACTION line
Notice that elements are separated by the & (ampersand) character and spaces are indicated by the % (percent) character. (The entire form is ast the end of this file -- but it has not been tested on the Rutgers system lately.)

	<FORM METHOD=post
	ACTION="http://info.rutgers.edu/cgi-bin/RUInfo/SubmitForm/
	name=email
	&url=http://andromeda.rutgers.edu/~ehrlich/465/465-1.html
	&title=465
	%20First
	%20Day:
	%20Fall_1998
	&to=ehrlich@andromeda.rutgers.edu">
	


6. The TEXT box

Live dummy example with code (See Castro, 196):

Type some text:

Type some text: <INPUT TYPE=TEXT NAME=TEXT1 VALUE="Tatoo me, baby!" SIZE=20 MAXLENGTH=40>


7. When a one-line TEXT box won't do, use TEXTAREA: (See Castro, 198)

  • <WRAP> values: <TEXTAREA NAME="mytextarea" ROWS=6 COLS=20>Just do it! ROWS=6 COLS=20> Just do it! </TEXTAREA>


    8. Radio Buttons (Castro 199)

    Check only one, please: (try checking two)
    Yes No Maybe

    <INPUT TYPE=RADIO NAME=RBOX VALUE=YES>Yes
    <INPUT TYPE=RADIO NAME=RBOX VALUE=NO>No
    <INPUT TYPE=RADIO NAME=RBOX VALUE=NO>Maybe

    The RADIO field has several attributes (one choice only):

  • <TYPE> -- here RADIO
  • <NAME> -- to identify it
  • <VALUE> -- the visible label on the screen
  • <CHECKED> -- if pre-selected (default)

    To operate as a group, all the members of a set of radio boxes must use the name Name attribute.


    9, Checkboxes. (See Castro, 200)

    Check one or more, please:
    Yes No Maybe
    <INPUT TYPE=CHECKBOX NAME=CHECKBOX1Y VALUE=YES>Yes
    <INPUT TYPE=CHECKBOX NAME=CHECKBOX1N VALUE=NO>No
    <INPUT TYPE=CHECKBOX NAME=CHECKBOX1M VALUE=NO>Maybe

    The CHECKBOX field has several attributes (multiple choice permitted):

  • <TYPE> -- here CHECKBOX
  • <NAME> -- to identify it
  • <VALUE> -- the visible label on the screen
  • <CHECKED> -- if pre-selected (default)

    Check one, with default marked:
    Yes No Maybe


    <INPUT TYPE=CHECKBOX NAME=CHECKBOX1Y VALUE=YES>Yes <INPUT TYPE=CHECKBOX NAME=CHECKBOX1N VALUE=NO>No <INPUT TYPE=CHECKBOX NAME=CHECKBOX1M CHECKED VALUE=NO>Maybe


    10. DROP-DOWN MENUS (SELECT) (Castro, 201)

    In your banana split?

    <SELECT NAME=SUNDAES SIZE=1>
    <OPTION>Pistachio
    <OPTION>Strawberry
    <OPTION>Vanilla
    <OPTION>Chocolate
    <OPTION>Peach
    </SELECT>

    ---
    <SELECT NAME=SUNDAES SIZE=3>
    <OPTION>Pistachio
    <OPTION>Strawberry
    <OPTION>Vanilla
    <OPTION>Chocolate
    <OPTION>Peach
    </SELECT>

    The <SELECT> tag creates a pull-down menu:

  • <TYPE< -- here SELECT
  • <NAME> -- to identify it
  • <MULTIPLE> -- permits multiple options to be selected
  • <SIZE> -- how many options to be displayed at once, default 1
  • <OPTION> -- identifies each possible selection
  • <VALUE> -- the visible label on the screen
  • <SELECTED> -- to preselect one option


    11. The SUBMIT field has several attributes: (Castro, 206-7

  • <TYPE> -- here SUBMIT
  • <VALUE> -- the visible label on the screen

    If INPUT TYPE=IMAGE, then a graphic can be used with the SRC attribute for the submit button. But there should be no doubt of its purpose.

    12. The RESET field has several attributes:(Castro, 208-209)

  • <TYPE> -- here RESET
  • <VALUE> -- the visible label on the screen

    The input type BUTTON is available for JavaScript programming. There is also a HIDDEN type for state data to be transmitted by a program. The PASSWORD type is like text but only asterisks are echoed on the screen.


    13. Using a free-form Button to trigger a Script:
    Working Example with code (looking ahead)

    <BUTTON TYPE="button" NAME="name" onClick="alert('Today is '+ Date())"> Hey, you got the time? </BUTTON>


    14. Designing forms:

  • The easiest way to design a form is to type it out as you would wish it to appear, using tabs and spaces top create logical groups and separations, and place it within <PRE>... </PRE> tags.

  • Keep in mind that a typical 640x480 screen can actaully use only anout 600x400, about 72 characters wide and 20 characters high in monspaced PRE formatting, slightly more with proportionally spaced characters.

  • You can use <BLOCKQUOTE> to separate content from the margins.

  • TABLES are a versatile way to handle screen prompts and input fields. Use the ALIGN attribute with Left and Right values to separate screen prompts and text entry areas.

  • The entire FORM will be displayed in the designated font in 4.0 browsers. But any portion of the FORM inside a TABLE will use the default font.

    15. Planning your information flow:

  • Think about fields you will really need and how you wish to order them. Today people fill out large numbers of forms pretty habitually but also are losing patience with unnecessary forms and extra elements in forms. If the form is voluntary, keep the good will of your users in mind. If the form is not voluntary, try to make its purpose clear.

  • Keep your users advised as to how the form will be used. A good deal of concern is felt recently about privacy and the possible inappropriate collection and misuse of data.

  • Some forms require only simple yes/no radio boxes which may be easily tabulated. Others require elaborate qualitiative statements which may be more more difficult to process. Thing about quantitative and qualitative aspects of your form and how you can best achieve your results.

  • Keep in mind that everything in the form, screen prompts as well as data, will probably come back to you by e-mail. Use some readily identifiable method of separating the prompts from the data so that your eye will be drawn mainly to the responses.

  • If you will receive large amounts of data, think of ways in which your prompts can be discarded or ignored and each response can be converted into a single database record with multiple internal fields.


    16. Tapping into CGI

    Follow this model:

    
    <FORM METHOD=post
       <! *** 1. OK to use *** -->
    ACTION="http://info.rutgers.edu/cgi-bin/RUInfo/SubmitForm/name=email
       <! *** 2. OK to use *** -->
    &url=http://andromeda.rutgers.edu/~ehrlich/465/465-1.html
       <! *** 3. Use your own form absolute address after &url=  ***-->
    &title=465
       <! *** 4. use your own document &title=  *** -->
    %20First
    %20Day:
    %20Fall_1998
       <! *** 5. use %20 for each space  ***
    &to=ehrlich@andromeda.rutgers.edu">
       <! *** 6. use your own e-mail address after &to= *** -->
       <! *** 7. carefully recheck everything and then put it on one line
    without spaces or hard returns. -->
    


    An example of a questionnaire form

    Last Name, then First Name:
    E-Mail address(es):
    Local telephone number:
    Personal web page URL:

    Part I: Please Check As Many As Apply

    1. I have done the following on World Wide Web:

      Browsed Used search engine Printed pages Downloaded pages Downloaded software Customized browser Viewed source

    2. Which type of web site would you most like to create?

      Personal Informational Recreational Commercial

    3. Which subject areas are the most interesting or important to you?

      Advertising/PR Arts and entertainment Business Crime/law enforcement Economic issues Education Environment/global issues Fashion/clothing Fitness/sports Gender/sexual issues Health/medicine Home/household/architecture International news Mass media Metropolitan New York National news Newark New Jersey Nutrition/diet/cooking Politics Recreation, music, amusement Reform/protest Science/technology Social issues Sports Travel/vacation

    4. What are your special skills or interests in this course (with which you might help others)?
      Writing Editing Research Searching Publishing Promotion Graphics Audio Video/Multimedia Hardware Software Networking Communications Project Management

    5. How do you usually access the Internet/Web:

      Windows 95/98 Windows 3.x DOS Macintosh Unix

    6. Please check the browsers you have used and name your favorite.

      Netscape Internet Explorer Lynx Opera

    7. If you know, what is the version of your browser?

      (unknown) 1 (oldest) 2 3 4 (newest)

    8. Are you familiar with using on-campus Rutgers computers at the:

      Computer labs Library Dorms

    9. Are you able to use off-campus computers regularly at

      Home Family/friends Job or work

    10. Which word processing or desktop publishing software do you use for formatted printing?

      Microsoft Word WordPerfect PageMaker

    11. Which plain text (non-formatting) editors have you used:

      Emacs Notepad PC-Write XyWrite WordStar

    12. Which Windows 95/98 operations or programs have you used ?

      Netscape Internet Explorer Windows Explorer Database Spreadsheet Presentation MS DOS prompt FTP Terminal Telnet Zip programs

    13. Which UNIX (Pegasus) operations or programs are you familiar with?

      E-mail Newgroups Lynx browser Editors (emacs, vi) File management FTP Telnet Zip utilities

    14. Which HTML editors/assistants/aids have you used?

    15. Do you use a commercial online service or internet service provider (ISP), and if so, which?
      (e.g., AOL, Prodigy, Mindspring, AT&T, etc.):

    This questionnaire (Part 1) is available online at http://andromeda.rutgers.edu/~ehrlich/465/465-1.html.

    Thank you for your patience. When finished, please click on "Submit Entry." Or click on "Clear and Reset" to start over.


    Code for the above

    
    <FORM METHOD=post ACTION="http://info.rutgers.edu/cgi-bin/RUInfo/SubmitForm/name=email&url=http://andromeda.rutgers.edu/~ehrlich/465/465-1.html&title=465%20First%20Day:%20Fall_1998&to=ehrlich@andromeda.rutgers.edu">
    <p>
    <Table border=0>
    <TR><TD><font face="Arial, Helvetica">
    Last Name, then First Name:
    </TD><TD><INPUT NAME="name"  TYPE="text"  VALUE=" "  SIZE="40" ALIGN="left">
    <TR><TD><font face="Arial, Helvetica">
    E-Mail address(es):
    </TD><TD><INPUT NAME="email"  TYPE="text"  VALUE="... @pegasus"  SIZE="50" ALIGN="left">
    </TD></TR><TR><TD><font face="Arial, Helvetica">
    Local telephone number:
    </TD><TD><INPUT NAME="phone"  TYPE="text"  VALUE="973- "  SIZE="20" ALIGN="left">
    </TD></TR><TR><TD><font face="Arial, Helvetica">
    Personal web page URL:
    </TD><TD><INPUT NAME="webpage"  TYPE="text"  VALUE="pegasus.rutgers.edu/~..."  SIZE="50" ALIGN="left">
    </TD></TR></TABLE>
    <p>
    <h3>Part I: Please Check As Many As Apply</h3>
    <p>
    <OL token="A">
    <B><LI>I have done the following on World Wide Web:</b>
    <p>
    <INPUT NAME="Browsed" TYPE="checkbox">Browsed
    <INPUT NAME="Search engine" TYPE="checkbox">Used search engine
    <INPUT NAME="Printed pages" TYPE="checkbox">Printed pages
    <INPUT NAME="Downloaded pages" TYPE="checkbox">Downloaded pages
    <INPUT NAME="Downloaded software" TYPE="checkbox">Downloaded software
    <INPUT NAME="Customized browser" TYPE="checkbox">Customized browser
    <INPUT NAME="Viewed source" TYPE="checkbox">Viewed source
    <p>
    <b><LI> Which type of web site would you most like to create?</b>
    <P><INPUT NAME="Personal" TYPE="checkbox">Personal
    <INPUT NAME="Informational" TYPE="checkbox">Informational
    <INPUT NAME="Recreational" TYPE="checkbox">Recreational
    <INPUT NAME="Commercial" TYPE="checkbox">Commercial
     <INPUT NAME="Other1" TYPE="text"  VALUE="Other ..."  SIZE="20" ALIGN="left">
    
    <p>
    <b><li> Which subject areas are the most interesting or important to you?</b>
    <P>
    <INPUT NAME="Advertising/PR" TYPE="checkbox">Advertising/PR
    <INPUT NAME="Arts and entertainment" TYPE="checkbox">Arts and entertainment
    <INPUT NAME="Business" TYPE="checkbox">Business
    <INPUT NAME="Crime/law enforcement" TYPE="checkbox">Crime/law enforcement
    <INPUT NAME="Economic issues" TYPE="checkbox">Economic issues
    <INPUT NAME="Education" TYPE="checkbox">Education
    <INPUT NAME="Environment/global issues" TYPE="checkbox">Environment/global issues
    <INPUT NAME="Fashion/clothing" TYPE="checkbox">Fashion/clothing
    <INPUT NAME="Fitness/sports" TYPE="checkbox">Fitness/sports
    <INPUT NAME="Gender/sexual issues" TYPE="checkbox">Gender/sexual issues
    <INPUT NAME="Health/medicine" TYPE="checkbox">Health/medicine
    <INPUT NAME="Home/household/architecture" TYPE="checkbox">Home/household/architecture
    <INPUT NAME="International news" TYPE="checkbox">International news
    <INPUT NAME="Mass media" TYPE="checkbox">Mass media
    <INPUT NAME="Metropolitan New York" TYPE="checkbox">Metropolitan New York
    <INPUT NAME="National news" TYPE="checkbox">National news
    <INPUT NAME="Newark" TYPE="checkbox">Newark
    <INPUT NAME="New Jersey" TYPE="checkbox">New Jersey
    <INPUT NAME="Nutrition/diet/cooking" TYPE="checkbox">Nutrition/diet/cooking
    <INPUT NAME="Politics" TYPE="checkbox">Politics
    <INPUT NAME="Recreation, music, amusement" TYPE="checkbox">Recreation, music, amusement
    <INPUT NAME="Reform/protest" TYPE="checkbox">Reform/protest
    <INPUT NAME="Science/technology" TYPE="checkbox">Science/technology
    <INPUT NAME="Social issues" TYPE="checkbox">Social issues
    <INPUT NAME="Sports" TYPE="checkbox">Sports
    <INPUT NAME="Travel/vacation" TYPE="checkbox">Travel/vacation
      <INPUT NAME="Other2" TYPE="text"  VALUE="Other ..."  SIZE="20" ALIGN="left">
    <p>
    <b><LI> What are your special skills or interests in this course (with which you might help others)?</b><br>
    <INPUT NAME="Writing" TYPE="checkbox">Writing
    <INPUT NAME="Editing" TYPE="checkbox">Editing
    <INPUT NAME="Research" TYPE="checkbox">Research
    <INPUT NAME="Searching" TYPE="checkbox">Searching
    <INPUT NAME="Publishing" TYPE="checkbox">Publishing
    <INPUT NAME="Promotion" TYPE="checkbox">Promotion
    <NIPUT NAME="Graphics" TYPE="checkbox">Graphics
    <INPUT NAME="Audio" TYPE="checkbox">Audio
    <INPUT NAME="Video" TYPE="checkbox">Video/Multimedia
    <INPUT NAME="Hardware" TYPE="checkbox">Hardware
    <INPUT NAME="Software" TYPE="checkbox">Software
    <INPUT NAME="Networking" TYPE="checkbox">Networking
    <INPUT NAME="Communications" TYPE="checkbox">Communications
    <INPUT NAME="Project Management" TYPE="checkbox">Project Management
    <INPUT NAME="Other10" TYPE="text"  VALUE="Other ..."  SIZE="25" ALIGN="left">
    <p>
    <B><li> How do you usually access the Internet/Web:</B>
    <p>
    <INPUT NAME="Windows 95/98" TYPE="checkbox">Windows 95/98
    <INPUT NAME="Windows 3.x" TYPE="checkbox">Windows 3.x
    <INPUT NAME="DOS" TYPE="checkbox">DOS
    <INPUT NAME="Macintosh" TYPE="checkbox">Macintosh
    <INPUT NAME="Unix" TYPE="checkbox">Unix
    <p>
    <B><li> Please check the browsers you have used and name your favorite.</b>
    <p>
    <INPUT NAME="Netscape" TYPE="checkbox">Netscape
    <INPUT NAME="Internet Explorer" TYPE="checkbox">Internet Explorer
    <INPUT NAME="Lynx" TYPE="checkbox">Lynx
    <INPUT NAME="Opera" TYPE="checkbox">Opera
    <INPUT NAME="Other3" TYPE="text"  VALUE="Favorite or other..." SIZE="30" ALIGN="left">
    <p>
    <b><li> If you know, what is the version of your browser? </b>
    <p>
    <INPUT NAME="0" TYPE="checkbox">(unknown)
    <INPUT NAME="1" TYPE="checkbox">1 (oldest)
    <INPUT NAME="2" TYPE="checkbox">2
    <INPUT NAME="3" TYPE="checkbox">3
    <INPUT NAME="4" TYPE="checkbox">4 (newest)
    <p>
    <B><li> Are you familiar with using on-campus Rutgers computers at the:</B>
    <p>
    <INPUT NAME="Computer lab" TYPE="checkbox">Computer labs
    <INPUT NAME="Library" TYPE="checkbox">Library
    <INPUT NAME="Dorm" TYPE="checkbox">Dorms
    <INPUT NAME="Other4" TYPE="text"  VALUE="Other ..."  SIZE="20" ALIGN="left">
    <p>
    <B><li> Are you able to use off-campus computers regularly at</b>
    <p>
    <INPUT NAME="home" TYPE="checkbox">Home
    <INPUT NAME="family" TYPE="checkbox">Family/friends
    <INPUT NAME="job" TYPE="checkbox">Job or work
    <INPUT NAME="Other5" TYPE="text"  VALUE="Other ..." SIZE="20" ALIGN="left">
    <P>
    <b><li> Which word processing or desktop publishing software do you use for formatted printing?</B><p>
    <INPUT NAME="Microsoft Word" TYPE="checkbox">Microsoft Word
    <INPUT NAME="WordPerfect" TYPE="checkbox">WordPerfect
    <INPUT NAME="PageMaker" TYPE="checkbox">PageMaker
    <INPUT NAME="Other6" TYPE="text" VALUE="Other ..." SIZE="25" ALIGN="left">
    <p>
    <B><li> Which plain text (non-formatting) editors have you used:</B><p>
    <INPUT NAME="Emacs" TYPE="checkbox">Emacs
    <INPUT NAME="Notepad" TYPE="checkbox">Notepad
    <INPUT NAME="PC-Write" TYPE="checkbox">PC-Write
    <INPUT NAME="XyWrite" TYPE="checkbox">XyWrite
    <INPUT NAME="WordStar" TYPE="checkbox">WordStar
    <INPUT NAME="Other7" TYPE="text"  VALUE="Other ..." SIZE="25" ALIGN="left">
    <p>
    <B><li> Which Windows 95/98 operations or programs have you used ?</B><p>
    <INPUT NAME="Netscape" TYPE="checkbox">Netscape
    <INPUT NAME="Internet Explorer" TYPE="checkbox">Internet Explorer
    <INPUT NAME="Windows Explorer" TYPE="checkbox">Windows Explorer
    <INPUT NAME="Database" TYPE="checkbox">Database
    <INPUT NAME="Spreadsheet" TYPE="checkbox">Spreadsheet
    <INPUT NAME="Presentation" TYPE="checkbox">Presentation
    <INPUT NAME="MS DOS prompt" TYPE="checkbox">MS DOS prompt
    <INPUT NAME="FTP" TYPE="checkbox">FTP
    <INPUT NAME="Terminal" TYPE="checkbox">Terminal
    <INPUT NAME="Telnet" TYPE="checkbox">Telnet
    <INPUT NAME="Zip programs" TYPE="checkbox">Zip programs
    <p>
    <B><LI> Which UNIX (Pegasus) operations or programs are you familiar with?</B><p>
    <INPUT NAME="E-mail" TYPE="checkbox">E-mail
    <INPUT NAME="Newgroups" TYPE="checkbox">Newgroups
    <INPUT NAME="Lynx browser" TYPE="checkbox">Lynx browser
    <INPUT NAME="Editors" TYPE="checkbox">Editors (emacs, vi)
    <INPUT NAME="File management" TYPE="checkbox">File management
    <INPUT NAME="FTP" TYPE="checkbox">FTP
    <INPUT NAME="Telnet" TYPE="checkbox">Telnet
    <INPUT NAME="Zip utilities" TYPE="checkbox">Zip utilities
    <p>
    <B><LI> Which HTML editors/assistants/aids have you used?</B><br>
    <INPUT NAME="HTMLed" TYPE="text" VALUE="Editors ..."  SIZE="25" ALIGN="left">
    <p>
    <B><LI> Do you use a commercial online service or internet service provider (ISP), and if so, which?</B><br>
    (e.g., AOL, Prodigy, Mindspring, AT&T, etc.):
    <INPUT NAME="ISP" TYPE="text" VALUE=" " SIZE="25" ALIGN="left">
    <p>
    
    </ol>
    <p>
    <P>
    This questionnaire (Part 1) is available online at <I>http://andromeda.rutgers.edu/~ehrlich/465/465-1.html</I>.
    <p>
    Thank you for your patience.  When finished, please click on
    "Submit Entry."  Or click on "Clear and Reset" to start over.
    <p>
    <INPUT TYPE="submit" VALUE="Submit entry">
    <INPUT TYPE="reset" VALUE="Clear and reset">
    </FORM></BODY></HTML>