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

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -