PDA

View Full Version : Scoring 25 <Select> buttons in a JavaScript Form


mmasci
09-06-2002, 01:38 AM
I have a series of 25 questions that I would rather set up as <select> list menus instead of radio buttons.

These 25 questions are broken down into 5 <option> tags, and I would like to customise feedback based on the scores of 3 arrays which I have broken the 25 questions down into.

I would also like to provide feedback on individual responses that are scored with one of the 5 options.

How do I refer to the options in each select button via the DOM, and how should I set up the function to evaluate the <select> button responses?

Cheers,

mmasci:(

joh6nn
09-06-2002, 09:09 AM
Originally posted by mmasci
How do I refer to the options in each select button via the DOM,[b]

document.theFormName.theSelectName.options[document.theFormName.theSelectName.selectedIndex].value

that will return the value of the option. you can also have it return the text of the option, by using .text, instead of .value.

Originally posted by mmasci
[B]and how should I set up the function to evaluate the <select> button responses?

i think the answer to that is dependent on the information in the select boxes, and what you want to do with them.