Friday 27 September 2013

Check string array [] value with Javascript

using script-
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">

function checkusername(value) {
 
    var codes = ['admin', 'adm', 'administrator', 'cluster', 'clu'];
     
        if ($.inArray(value.toLowerCase(), codes) > -1) {          
            alert("Invalid userid ! Please try another");
            return false;
        }

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...