topical media & game development

talk show tell print

lib-ch-example-form-example-4.htm / htm



  <TITLE>Fill-Out Form Example #4</TITLE>
  <body bgcolor="#FFFFFF" text="#000000" vlink="#FF0000">
  <H1>Fill-Out Form Example #4</H1>
  
  This is another fill-out form example, with default values for some
  text entry fields and checkboxes. <P>
  
  <HR>
  
  <FORM METHOD="POST" ACTION="lib-ch-example-form-form.cgi">
  
  The first text entry field, with default value "foo", goes here:
  <INPUT NAME="entry1" VALUE="foo"> <P>
  
  The second text entry field, with no default value, goes here: <INPUT
  NAME="entry2"> <P>
  
  Now, here's three checkboxes right in a row: <P>
  
  <OL>
  <LI> <INPUT TYPE="checkbox" NAME="box1" VALUE="activated" CHECKED> The first
       checkbox, on by default.
  <LI> <INPUT TYPE="checkbox" NAME="box2" VALUE="primed"> The second
       checkbox, off by default.
  <LI> <INPUT TYPE="checkbox" NAME="box3" CHECKED> The third
       checkbox, on by default.
  </OL>
  
  To submit the query, press this button: <INPUT TYPE="submit"
  VALUE="Submit Query">.   <P>
  
  To reset the various form elements to their default states, press this
  button: <INPUT TYPE="reset" VALUE="Reset To Default Values">. <P>
  
  </FORM>
  
  <HR> <P>
  
  Things you may want to note: <P>
  
  <UL>
  <LI> A <CODE>VALUE</CODE> attribute to an <CODE>INPUT</CODE> tag of
       <CODE>TYPE</CODE> "text" specifies the default value of that text
       field.
  <LI> A <CODE>VALUE</CODE> attribute to an <CODE>INPUT</CODE> tag of
       <CODE>TYPE</CODE> "checkbox" specifies the value that checkbox
       takes when it's on.  If this attribute is not present, the
       default is "on".
  <LI> A <CODE>CHECKED</CODE> attribute to a checkbox specifies that the
       checkbox is on by default.
  <LI> Similar to how an <CODE>INPUT</CODE> tag of <CODE>TYPE</CODE>
       "submit" is a special query submission button, an
       <CODE>INPUT</CODE> tag of <CODE>TYPE</CODE> "reset" is a special
       form reset button.  (If all of the input elements have no default
       values, this may be better termed a "clear" button; the label on
       the pushbutton included in the form is controlled by the
       <CODE>VALUE</CODE> attribute to that <CODE>INPUT</CODE> tag.)
  </UL>
  
  <A HREF="lib-ch-example-form-example-3.htm">Back to example 3</A> or <A
  HREF="lib-ch-example-form-example-5.htm">forward to example 5</A>. <P>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.