jQuery multiply and addition not adding total value
Please take a look at the following URL: http://jsfiddle.net/XBtgD/2/.
The additions are working fine, however the multiplication part doesn't add up at all.
Any ideas on how to get the 开发者_StackOverflow中文版multiplication working along with the additions?
Any help would be greatly appreciated.
You have class="sum" for you sums, but you are missing class="mult" for the multiple inputs.
Need the :checked
function calcWM()
{
    var a = parseInt( $('input:radio[name=package]:checked').val());
    alert(a);
    var b = parseInt( $('input:radio[name=job]:checked').val());
    var c = parseInt( $('input:radio[name=months]:checked').val());
    a = isNaN(a) ? 0 : a;
    b = isNaN(b) ? 0 : b;
    c = isNaN(c) ? 0 : c;
    wmValue = a * b * c;       
}
For starters there are no inputs with class "mult", and I suppose the multiplication function should do a
total *= parseInt(value) 
...instead of a
total += parseInt(value)
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论