When a user makes a change to the input field “vmake” i want a hidden input called “carsearch” to change its value from False to True. The default value of the hidden input is False. Here is my script:
$(function(){
$("#vmake").change(function(){
$("#carsearch").val('True');
});
});
If its helful the HTML for the hidden input is:
<input id="carsearch" type="hidden" name="carsearch" value="False" />
You set
valas an attribute to yourinputelement. It should bevalue.Sample
Check out this jsFiddle Demonstration