Issues disabling/enabling multiple inputs in JQuery

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.

以上就是Issues disabling/enabling multiple inputs in JQuery的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏