Monday, June 2, 2008

Trim Function

function strtrim()
{
return this.replace(/^\s+/,'').replace(/\s+$/,'');
}

String.prototype.trim = strtrim;

usage
if(document.getElementById(FinalControlID1).value.trim()=="")

No comments: