I am still learning jquery but I am wondering why this code does not work. I have a select field called item_name and a hidden field called amount. Based on the selection in item_name, I want to set the value of the hidden field (amount) to a set value. For example:
$(document).ready(function () {
$('#item_name').change(function () {
var value = $('#item_name').val();
if(value == "institutional memberhip"){
$("#amount").val("$349.00");
} elseif(value == "individual membership") {
$("#amount").val("$40.00");
} else {
$("#amount").val("$99.00");
}
});
});
What stupidity have I committed here that this does not work?
Dave