Created
May 7, 2010 14:26
-
-
Save ScottRadcliff/393482 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Grabs the size selected and adds it to the total | |
$("select[name = 'sizes[]']").click(function(){ | |
var sizes = $("select[name = 'sizes[]']"); | |
var counter = 0; | |
for (var i=0; i < sizes.length; i++) { | |
counter = Number(counter) + Number(sizes[i].value); | |
}; | |
sub_total = counter; | |
$("#sub_total").text("$" + sub_total + ".00"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Grabs the size selected and adds it to the total | |
$("select").change(function(){ | |
var sizes = $("select[name = 'sizes[]']"); | |
var counter = 0; | |
for (var i=0; i < sizes.length; i++) { | |
counter = Number(counter) + Number(sizes[i].value); | |
}; | |
sub_total = counter; | |
$("#sub_total").text("$" + sub_total + ".00"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment