I'm having a little trouble adding a 'required' attribute to a select box when a checkbox is checked.
Here's my code so far.
$('.turn_on').change(function(){
$('.form_field select').attr('required');
});
If anyone could help, that would be greatly appreciated.
Use .prop(propertyName, value)
set the property
$('.turn_on').change(function(){
//set required to true/false based on checked box checked state
$('.form_field select').prop('required', this.checked);
});