Sunday, March 7, 2010

Java Tutorial

Java Tutorial link for beginners

Validation for spaces in a textbox

function removeBlanks(s){
s = s.replace(/(^\s*)|(\s*$)/gi,"");
s = s.replace(/[ ]{2,}/gi," ");
s = s.replace(/\n /,"\n");
return s;
}

The function can be used to remove the spaces & validate a textbox.