Question: 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');
});

```

Answer: 
It looks like you're using the wrong selector and event for the checking of a check box. Use the `click` event to see changes in the `checked` state of a check box

```
$('#year').click(function() {
  var checked = $(this).is(':checked');
  var value = checked ? 'True' : 'False';
  $('#carsearch').val(value);
});

```
IS your CheckBox's ID really "year[]"? That doesn't seem like a good choice for an ID. Remember, you should always have unique ID's.