Thursday, June 1, 2017

Check Special Character Exists in String or Not JQUERY

HI all,

Please find the JQuery to check weather Given Special Character Exists in String or not

$(document).ready(function () {
    var charReg = /[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/;
    $('#firstNametxtId').keyup(function () {
        var isValid = false;
        var inputVal = $(this).val();
        if (inputVal != "") {
            if (charReg.test(inputVal)) {
                isValid = true;
            }
        } else {
           
        }
    });
});

No comments:

Post a Comment

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...