Activity Forums Salesforce® Discussions How to validate Subdomain in JavaScript custom button?

  • Abhinav

    Member
    April 13, 2016 at 1:16 pm

    Hello, you can use the following function to check the above subdomain on the custom button :-

    function validSubdomain() {
    var validCases = /[^a-zA-Z0-9\-]/;
    var valueOfSubDomain = 'mySubdomain'
    if(validCases.test(valueOfSubDomain)) {
    alert("invalid Subdomain");
    }
    else{
    alert("valid Subdomain");
    }
    }

    Hope this will work.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos