Simple jQuery Price Updating problems dropdown vs radio button -
so figured out how update price via jquery, radio buttons:
here link: http://jsfiddle.net/pcvr7h2b/5/
now problem having applying exact same function dropdowns, "option" values. want price change when dimension selected in dropdown.
i added in code here:
$("option:selected").each(function() { var value = $(this).attr("value"); total += parseint(value); });
trying work, having no luck. ideas?
thanks!
i don't know ultracart is. regardless of ultracart, here how implement purpose. http://jsfiddle.net/matildayipan/01ekur6u/
function total(){ var total = 0; var opt3 = parseint($("select[name='optionvalue3'] option:selected").val()); var opt4 = parseint($("select[name='optionvalue4'] option:selected").val()); total = opt3 + opt4; return total; } $(document).ready(function(){ var num = total(); $("#total").append(num); $("select").on('change', function(){ num=total(); $("#total").html(num); }); });
see if can merge main code, , hope works purpose.
Comments
Post a Comment