[jQuery] Re: calculate value of input based on two selects
thanks morningz - that's a lot neater than my solution: $(document).ready(function(){ $("#sweets").change(function (){ var str = ""; $("select option:selected").each(function (){ str += $(this).text() + " "; });
[jQuery] Re: calculate value of input based on two selects
Assuming you have something like 1 2 3 1 2 3 Then the jQuery could be: $("#select1, #select2").change(function() { $("#total").val( Number($("#select1").val()) * Number($ ("#select2").val()) + 1 ); }); On Mar 5, 4:05 pm, "black.horizons" wrote: > hi guys,