CS 101 Web Construction,
Fall 2011, Instructor: Jeffrey Horn ASSIGNMENTS
- Assignment 6 "Survey Forms"
- Handed out: Monday,
Nov. 7, 2011
- Due: Before Thanksgiving!
-
-
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 that uses two forms: one form
conducts a poll (i.e., survey) that you create and the other
form conducts a particular
poll we have created (8 questions) . Test your survey forms to make sure
they work with the scripts, then upload your survey page to a
web server and ask users to take the quiz. Send me the URL.
- The value of the
"action" attribute for both of your "<form>" elements should be
"http://www.ballot-box.net/service3/poll.vote.php"
- Named data
fields: You will need to follow these rules carefully and
completely!
- For the CLASS
POLL (poll ID: 26651):
- In your form
you will need
a FIXED data field (i.e., make it "type='hidden' "). It
needs to have name="pollid" and value="26651".
- There are
four questions in the survey and hence you will need four
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 data field 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!
- For your INDIVIDUAL POLL (poll ID:
whatever, you must get this from the ballot-box.net site)
- Create your own poll on
ballot-box.net with
four questions.
- At least one question must use mutual
exclusion.
- At least one question must use check
boxes (i.e., not mutual exclusion).
-
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!
- Use <fieldset> and <legend> elements to
group the questions from the two forms into two separate,
labeled sections of your survey page.
- Upload your
survey form to the web and test it. Then send me the URL.
(jhorn@nmu.edu)