Select:
<div class="span2" class="checks" >
<h4>BRANCO</h4>
<img src= "/images/cor-05.jpg" width="57" height="27">
<input type="checkbox" data-id="TRANSPARENTE" name="cor5" value="BRANCO" />
<label for="lineatura5">Lineatura<span class="required"></span></label>
<select class="span6" name="lineatura5" id="lineatura5" value="">
<option value="">Selecione</option>
<option value="52">52</option>
<option value="42">42</option>
</select>
</div>
Function:
$('select[name="substrato_imprime"]').on('change', function(){
$('.checks').find('input[type="checkbox"]').each(function(){
$(this).prop('checked', false);
});
if($(this).val() !== ''){
$('input[data-id="'+$(this).val()+'"]').prop('checked', true);
}
});
Checkbox:
<input type="checkbox" data-id="TRANSPARENTE" name="cor5" value="BRANCO" />
In a select field above this checkbox, I have 4 options: TRANSPARENT, FOSCO, PEARL AND METALLIC.
I have a function that if I choose the option "TRANSPARENT", for example, this checkbox above is marked. Except that I need the "FOSCO" and "METALIZADO" options also happen this marking, if it is chosen in the select field. Is there a way to pass more than one id so that the function does not just do the "TRANSPARENT" option?
PHP is the language.