mtd
01-21-2006, 04:46 PM
Hi!
I have a survey form like so:
<tr>
<td>Registration Process</td>
<td><input name="B" type="radio" value="0"></td>
<td><input name="B" type="radio" value="1"></td>
<td><input name="B" type="radio" value="2"></td>
<td><input name="B" type="radio" value="3"></td>
<td><input name="B" type="radio" value="4"></td>
<td><input name="B" type="radio" value="5"></td>
</tr>
<tr>
<td>Cost</td>
<td><input name="C" type="radio" value="0"></td>
<td><input name="C" type="radio" value="1"></td>
<td><input name="C" type="radio" value="2"></td>
<td><input name="C" type="radio" value="3"></td>
<td><input name="C" type="radio" value="4"></td>
<td><input name="C" type="radio" value="5"></td>
</tr>
etc... Where a user can rate items from 1-5 (5 being best); the "0" value is a "not applicable" option.
My Question: How can I display a total score at the end (i.e. 26/30 points)? I have seen this done with shopping carts, etc, but I don't need any currency options, just the ability to add/subtract the integer point values.
ALSO, it is important that if a user selects a "n/a (0)" for a category, that the total possible points are lowered to reflect that. For example, if there are 3 categories and the selection is as follows:
1) "n/a" (0)
2) "n/a" (0)
3) "4" (4)
then the score will be 4/5, not 4/15.
Anyone know how to do this with Javascript? I am not very familiar with JS, so any help is appreciated (I'm more of a server-side guy). Cross-browser is good, but not essential.
Thanks!
I have a survey form like so:
<tr>
<td>Registration Process</td>
<td><input name="B" type="radio" value="0"></td>
<td><input name="B" type="radio" value="1"></td>
<td><input name="B" type="radio" value="2"></td>
<td><input name="B" type="radio" value="3"></td>
<td><input name="B" type="radio" value="4"></td>
<td><input name="B" type="radio" value="5"></td>
</tr>
<tr>
<td>Cost</td>
<td><input name="C" type="radio" value="0"></td>
<td><input name="C" type="radio" value="1"></td>
<td><input name="C" type="radio" value="2"></td>
<td><input name="C" type="radio" value="3"></td>
<td><input name="C" type="radio" value="4"></td>
<td><input name="C" type="radio" value="5"></td>
</tr>
etc... Where a user can rate items from 1-5 (5 being best); the "0" value is a "not applicable" option.
My Question: How can I display a total score at the end (i.e. 26/30 points)? I have seen this done with shopping carts, etc, but I don't need any currency options, just the ability to add/subtract the integer point values.
ALSO, it is important that if a user selects a "n/a (0)" for a category, that the total possible points are lowered to reflect that. For example, if there are 3 categories and the selection is as follows:
1) "n/a" (0)
2) "n/a" (0)
3) "4" (4)
then the score will be 4/5, not 4/15.
Anyone know how to do this with Javascript? I am not very familiar with JS, so any help is appreciated (I'm more of a server-side guy). Cross-browser is good, but not essential.
Thanks!