I have a dropdown and I want to validate, make it mandatory only if a checkbox is checked, otherwise it is not required
I tried to do according to JSFiddler link
<form action="#" method="post" id="Form">
<input type="checkbox" id="L3chk" name="L3chk" value="true" />
<select id="RadioId" class="form-control" >
<option disabled selected>--- Selecione ---</option>
<option value="1">Opc 1</option>
<option value="2">Opc 2</option>
</select>
<button type="submit" class="btn btn-danger">Enviar</button>
</form>
$(document).ready(function () {
$("#Form").validate({
rules: {
RadioId: { required: "#L3chk:checked" }
}
})
});