I'm preparing a website for my sister where you can choose from the list some items and they will show under the list - for that I'm using asmselect script. To this point everything works perfectly for me and since I'm a total newbie when it comes to jquery, I don't change any of the original code. But the problem is that my sister would like every item of the list to have assigned price and she would like the chosen prices to sum up under the list. So what she would like to accomplish is something quite similar to for example that but the whole design has to look like at the asmselect - there's gotta be only one list. I tried to implement to the original code values for every list option and than using the standard summing jquery code (something like there) and then the code which I wrote about
$(function () {
var fields = $('#form1 :input').change(calculate);
function calculate() {
var price = 0;
fields.each(function () {
price += +$(this).val();
})
$('#price').html(price.toFixed(2));
}
})
but it doesn't work - probably because to be honest I don't know what I'm doing. As I wrote - I'm a total newbie to that and every prompt or idea how to do that would be greatly appreciated! I've been trying on my own to change original codes (I know I shouldn't do that) for a few days now and still no clue what to do next and have no one to ask about it.