'), n.next("span").next("span").next("span").removeClass("glyphicon-ok-sign alert-success"), !1) : (n.next("span").next("span").next("span").html(''), n.next("span").next("span").next("span").removeClass("glyphicon-remove-sign alert-danger"), n.addClass("valid").removeClass("input-validation-error"), n.next("span").next("span").next("span").addClass("field-validation-valid"), n.next("span").next("span").next("span").removeClass("field-validation-error"), !0) } return !0 } function txtEndUseChk() { if ("Distributor/Reseller" == $("#CustCompanyType").val()) { var n = $("#EndUse"); return "" == n.val().trim() ? (n.next("span").next("span").html(''), n.next("span").next("span").removeClass("glyphicon-ok-sign alert-success"), !1) : CheckISValid_EndUse(n.val().trim()) ? (n.next("span").next("span").html(''), n.next("span").next("span").removeClass("glyphicon-remove-sign alert-danger"), n.addClass("valid").removeClass("input-validation-error"), n.next("span").next("span").addClass("field-validation-valid"), n.next("span").next("span").removeClass("field-validation-error"), !0) : (n.next("span").next("span").html(''), n.next("span").next("span").removeClass("glyphicon-ok-sign alert-success"), !1) } return !0 } function CheckISValid_EndUse(n) { return /^(?!.*[\(\)]{2})(?!.*[\&]{2})(?!.*[\-]{2})(?!\d+$)(?=.*[a-zA-Z])(?:[a-zA-Z0-9 )(&-]{2,})?$/.test(n.toLowerCase()) ? 1 : 0 } $(document).ready(function () { setDropDownType(), $("#CountryOfEndUse").select2(), $("#CountryOfEndUse").on("select2:close", function () { setTimeout(function () { $(".select2-container-active").removeClass("select2-container-active"); var n = $("#CountryOfEndUse"); return "" == n.val().trim() ? (n.next("span").next("span").next("span").html(''), n.next("span").next("span").next("span").removeClass("glyphicon-ok-sign alert-success"), !1) : (n.next("span").next("span").next("span").html(''), n.next("span").next("span").next("span").removeClass("glyphicon-remove-sign alert-danger"), n.addClass("valid").removeClass("input-validation-error"), n.next("span").next("span").next("span").addClass("field-validation-valid"), n.next("span").next("span").next("span").removeClass("field-validation-error"), !0) }, 1) }), $("#CountryOfEndUse").on("select2:open", function () { $("#CountryOfEndUse").next("span").next("span").addClass("mdline") }), $(".select2-selection").on("focus", function () { $(this).parent().parent().next("span").addClass("mdline") }), $(".select2-selection").on("focusout", function () { $(this).parent().parent().next("span").removeClass("mdline") }) }), $("#CustCompanyType").change(function () { setDropDownType() }), $("#CountryOfEndUse").focus(function () { $("#CountryOfEndUseDiv .materialinput").html("Country of End Use*") }), $("#EndUse").focus(function () { $("#EndUseDiv .materialinput").html("Enter End Use*") });