Forums

This topic is locked

Tallying Radio Buttons

Posted 29 Jun 2007 19:05:24
1
has voted
29 Jun 2007 19:05:24 Jim Crandell posted:
I am making a number of web pages (using Dreamweaver MX 2004) that uses radio buttons that require a yes or no (Go/No-Go) response on a number of steps. I need to tally the responses by percentage and highlight one of three other radio buttons (these three do not necessarily have to be radio buttons) – Trained, Practice, and Untrained.

For example, the basic logic is something like this:

If Yes responses < 50% then highlight Untrained button
If Yes responses are > 51% but < than 69% highlight the Practice button
If Yes responses are > than 70% then highlight the Trained button

However, it might be easier to check for the first two conditions first:

If Yes responses are < 50% highlight Untrained button
If Yes responses are > 70% highlight Trained button
Else highlight Practice button

Furthermore, I thought of using a constant of two variables, one as a counter to count how many yes responses the other simply holds the total number of questions, such as:
Total questions = 20

If Yes answers are <= 20 then highlight Untrained button
If Yes answers are => 70 then highlight Trained button
Else highlight Practice button

However, each page will have a different number of questions and we will eventually have dozens (maybe hundreds) of pages – I would have to write a different statement for each page. Also, another possibility (or variable) may exist in some instances; a question could be left blank for an N/A response. Therefore, I was thinking of using a Submit button together with percentages to determine the outcome for each situation. And the outcome must post on the same page as the questions.
Do any of you have any advice, ideas, or (easy for me to understand) code on how I can make all of this work on web pages?
Thank you. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Jim<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic