So I want to change a hidden form field's value from False to True when the user enters input data in another form field. This works fine with my select fields (dropdowns) in my form, but for my checkboxes and text input fields it isn't working. This is my code
$(function(){
$('#vmake').change(function(){
$('#carsearch').val('True');
});
});
So when they change the vmake field (a dropdown menu), the carsearch field changes its value to True. This works fine so I figured that if that worked, I could do the same thing with any text input, or checkbox, but it doesn't seem to work. Is the .change event not appropriate to define a text input or a checkbox? Should I use a different event handler? This is an example of me trying to do the same thing with a checkbox field, but it doesn't work.
$(function(){
$('#year[]').change(function(){
$('#carsearch').val('True');
});