jquery - Add multiple value from group two and one from group 1 with radio and checkbox -
i have used html , javascript code this post @ my test website.
i want change radio button second group checkbox, user can select multiple option group 2 , should add 1 value of radio button selected group 1 , 1 or more values selected through checkboxes in group two, adding 1 values of check box. please check test url understand issues. want place paypal code payment total sum, should place that. if want have 3 groups in future, do. please take time this. new javascript.
$('#b1').click(function () { var total = 0; $("input[type=radio]:checked").each(function () { total += parsefloat($(this).val()); }); $('input[type="checkbox"]:checked').each(function () { total += parsefloat($(this).val()); }); $("#totalsum").val(total); });
$('input[type="checkbox"],input[type=radio]').change(function () { var total = 0; $("input[type=radio]:checked").each(function () { total += parsefloat($(this).val()); }); $('input[type="checkbox"]:checked').each(function () { total += parsefloat($(this).val()); }); $("#totalsum").val(total); });
Comments
Post a Comment