var group1 = $('input[name=group1]:checked').attr("value");
var group2 = $('input[name=group2]:checked').attr("value");
var group3 = $('input[name=group3]:checked').attr("value");
This will grab the value of the selected radio button within each of
your groups.
Then do some math to add up you
It sounds strange that value="2" would be the number of points.
Usually, a value would be used to indicate a unique answer for a
question. Usually, 1, 2, 3, 4 if you have 4 possible answers for one
question. I would suggest using the ID or CLASS attribute, or
Javascript objects to store that type
Something like this:
$(button).click(function(){
var total = 0;
$(input:radio).each(function(){
total += $(this).val();
});
alert(total);
return false;
});
On Mon, Jul 27, 2009 at 16:41, briggs81 wrote:
>
> This is probably simple, but I am new to jQuery and am tryin
3 matches
Mail list logo