jquery unhide on the value of a select drop down
I want to get at the value of a select box on change and hide or unhide another elemen in the same form determined on value selected so far I have something that doesn't even trigger.....
if the content of "arrival" is VIP I want to unhide "arrival_time"
eg the form contains
<p><label for="id_arrival">Arrival:</label> <select name="arrival" id="id_arrival"><option value="" selected="selected">---------</option> <option value="1">STD</option> <option value="2">VIP</option> </select></p>
<p><label for="arrival_time">Arrival time:</label> <select name="arrival_time" id="id_arrival_time"> <option value="" selected="selected">---------</option> <option value="1">08:00</option> <option value="2">09:00</option> </select></p>
so far this does not trigger at all
<script>
function(getVals){
var sv = $('#id_arrival').val();
alert("YYYYYYY")
if sv = "VIP"{
alert('XXXXXXXXX');
}
}
$("select").change( getVals );
</script>
Haing many selects in the form probably doesn't help and I want to try to keep {{ form.as_p }} is the template if at all possible
tried this as well
$('#id_arrival').('change', function() {
alert( this.value };
});
no trigger
Appreciate any help