Validate space in Java Script

by admin on February 20th, 2012

function trim() {

ogg =document.getElementById(‘testid’).value;
ogg1 = /\S+/.test(ogg);
//return /\S+/.test(ogg);
if(ogg1==” “){alert(‘blank’);}
else{alert(ogg1);}
}
end script
input type=”text” onblur=”trim();” id=”testid”

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>