Javascript: Validation for special charaters
<p>Im working on some validations and can't seem to wrap my head around checking for special chars, none should be used. Currently I grab the value, make an array and check for uppercase and numbers. I need a way to check for special chars as well. Another small issue I found is that it passes an uppercase when a number is entered. Just looking for some direction on how to tackle this.</p>

<pre><code>$('.tooltip').on({  
    focusin: function(){ //make
        var top = $(this).offset().top 
        var left = $(this).offset().left + $(this).outerWidth()

        $('.tip').remove()
        $('body').append("&lt;div class='tip' style='top:"+ top +"px;left:"+left+"px;'&gt;&lt;div class='arrow'&gt;&lt;/div&gt;&lt;/div&gt;")
        $('.tip').animate({width: 'show', opacity: 'show'})
        $(tipContent).appendTo('.tip')
    },
    focusout: function(){ //remove
        $('.tip').fadeOut(function(){$(this).remove()})
    },
    keyup: function(){ if (event.keyCode == 16) return //validate       
        var val = $(this).val()
        validate(val.split(""), val);
    },
})

function validate(letters, val){
    for (var i = 0; i &lt; letters.length; i++){
        if( letters[i] === letters[i].toUpperCase() ) { //uppercase check
              console.log(letters[i] + ": " + 'Uppercase Passed');
        }else{console.log('Uppercase Failed');
        } 

        if( letters.length &gt;= 9 ) { //min limit
              console.log(letters[i] + ": " + 'Minimum Limit Passed');
        }else{console.log('Minimum Limit Failed');
        }

        if( parseInt(letters[i]) &gt; 0 ) { //number check
              console.log(parseInt(letters[i]) + ' passed');
        }else{console.log('at least 1 char failed');
        } 
    }
}
</code></pre>
