Im trying to set up a form where a user has to pick an option from a select or enter a value in an input. One must be required but not both. I was attempting to write an if else statement
if the state is selected then remove the class on province, if province is filled then remove class on state
$("#state").bind('change' , function() {
if ( $(this).is(':selected') ) {
$(this).parents('.foreign').removeClass("required");
}
else{
$(#province).is(':filled');
$(this).parents('.usa').removeClass("required");
}
});
But I know this is not how to do it. Hopefully someone gets the idea of what I am trying. thanks in advance! Basically you can pick this or that but not both.