Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zirosas/d1f689b2d85a9809d28e to your computer and use it in GitHub Desktop.
Save zirosas/d1f689b2d85a9809d28e to your computer and use it in GitHub Desktop.
$(document).ready(function(){
$("#myForm").validate({
rules: {
myDropDown:{
required: function (element) {
if($("#myCheckbox").is(':checked'))
{
var e = document.getElementById("myDropDown");
if(e.options[e.selectedIndex].value=="")
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment