JavaScript & DHTML - How to write a JavaScript function which checks for special symbols with regular expression?
<script> function ContainsSpecialSymbols(strInput) { // put here whatever symbols you might need to check var reg = new RegExp("#|%"); if (reg.test(strInput)) { return true; } else { return false; } } alert(""+ContainsSpecialSymbols("exam#mple"));
Category: | JavaScript & DHTML |
<< Go back