I have a form with an "OR" condition that either dims/disables 3 input fields or 1 input field depending on if there are entries in each.
I'm having a lot of trouble with inconsistent results with this--namely when the user tabs through inputs--and could really use some help.
The code that's problematic is:
$(document).ready(function() {
$("#firstInitial,#lastName,#memberNo").blur(function() {
if ($(this).val() != '')
$("#datepicker").attr("disabled", "disabled").addClass("disabledStyle").val('');
else
$("#datepicker").attr("disabled", "").removeClass("disabledStyle");
});
});
I'm trying to dim/disable a datepicker field when there's an entry in either firstInitial, lastName, or memberNo, or any combination of those three--and undisable datepicker if entries are removed in these. What's happening is tabbing through these breaks everything and causes inconsistent results.
Is there another technique I could try?
Thanks.