JAVASCRIPT
Share the Knowledge
Sunday, July 24, 2011
Validate Empty spaces in Javascript
function checkSpaces(elm , fieldName){
var name = elm.value
name = name.replace(/(\s+)+/g," ");
if(name == "" || name == " "){
alert(fieldName +" should not allow empty spaces");
elm.focus();
return true;
}
return false;
}
No comments:
Post a Comment
Please comment on this
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Please comment on this