CS 101 Web Construction,
Winter 2011, Instructor: Jeffrey Horn ASSIGNMENTS
- Assignment 6 "Survey Forms"
- Handed out: Monday,
March 28, 2011
- Due: Tuesday, April 5, 2011
-
-
Goals Learn
how to work with a realistic server-side script by implementing a
medium-size survey form.
- Learn to be the interface between user and (script) programmer.
- Learn how to use external style sheets
- Learn to use form grouping elements <legend> and <fieldset>
- Overall: Create
a web page with a survey form on it that conducts a particular
survey we have created (8 questions) . Test your survey
form to make sure it works with the script, then upload it to a
web server and ask users to take the quiz. Send me the URL.
- The value of the
"action" attribute for your "<form>" element should be
"http://www.ballot-box.net/service3/poll.vote.php"
- Named data
fields: You will need to follow these rules carefully and
completely!
- You will need
one FIXED data field (i.e., make it "type='hidden' "). It
needs to have name="pollid" and value="25357".
- There are
eight questions in the survey and hence you will need eight
data fields for them, to be complete. The following images
show how the survey results are printed. They are in
order. The name for each datafield is of the form
"answer[#][]", where the '#' is the number of the
question. Thus the names go "answer[1][]" for question 1,
"answer[2][]" for question 2, etc. For the values of the
questions (i.e., the value of the "value" attribute), these
are simply the numerals 1,2,3, ... So for example the
value for answer choice 1, of question 1, is "1".
- You will
also, of course, need a submit button! (<input
type="submit">)
-
Here is
a an example of the report with survey results that is
generated by the server-side script. The wording of your
questions and answers do not have to be EXACTLY the same,
but if they are too different, users who take the survey
might complain that what the answered is not what was
compiled into the survey results!
- Use the <link> element to link to
external style sheet at
http://cs.nmu.edu/~jeffhorn/css/forms.css.
You will know that this is working when you see your form
style change as viewed in a browser!
- Upload your
survey form to the web and test it. Then send me the URL.
(jhorn@nmu.edu)