Programming Exercise I Construction (Cont.)

  1. Web User Interface Construction [(X)HTML]
  2. (X)HTML is short for (eXtensible) HyperText Markup Language, the authoring language used to create documents on the World Wide Web. (X)HTML defines the structure and layout of a web document by using a variety of tags and attributes.

    ~/public_html/course/520/2/10.html   (HTML)   (text)
    01<html>
    02 ...
    03 <form method="post"
    04   action="http://undcemcs01.und.edu/~wen.chen.hu/cgi-bin/demo/10/ListCourses.cgi">
    05  Students’ names:
    06  <input type="checkbox" name="Poke Mon"  value="1" checked="checked" /> Poke Mon,
    07  <input type="checkbox" name="Sponge Bob" value="1" /> Sponge Bob,
    08  <input type="checkbox" name="all"     value="1" /> All students, or
    09  <input type="text"     name="student" value="Mon" size="10" />
    10  <input type="submit"   name="act"     value="List courses" />
    11  <input type="submit"   name="act"     value="HTML source" />
    12  <input type="submit"   name="act"     value="CGI source" />
    13  <input type="submit"   name="act"     value="Perl source" />
    14  <input type="submit"   name="act"     value="Java source" />
    15  <input type="submit"   name="act"     value="SQL source" />
    16  <input type="submit"   name="act"     value="Help" />
    17  <input type="reset"                   value="Reset" />
    18 </form>
    19   ...
    20</html>
    http://undcemcs01.und.edu/~wen.chen.hu/course/520/2/9.html

      Students’ names:   Poke Mon,   Sponge Bob,   All students,   or

       
    http://undcemcs01.und.edu/~wen.chen.hu/cgi-bin/demo/10/ListCourses.cgi

    HTML forms are used to select different kinds of user input. A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.) in a form.

    • type="checkbox", which lets a user select one or more options of a limited number of choices,
    • type="text", which specifies a single line text entry field within the form that contains it,
    • type="submit", which submits the form when a user clicks the button, and
    • type="reset", which re-sets all the fields in the form to their initial values when a user clicks the button.