Index: lams_central/web/includes/javascript/common.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/common.js,v diff -u -r1.3 -r1.3.2.1 --- lams_central/web/includes/javascript/common.js 1 Oct 2006 22:30:02 -0000 1.3 +++ lams_central/web/includes/javascript/common.js 12 Mar 2007 01:30:06 -0000 1.3.2.1 @@ -45,4 +45,32 @@ target.value=srcV.replace(/\n/g,"
"); } + } + function trimAll( strValue ) { + var replaceExpr = /^(\s*)$/; + + //check for all spaces + if(replaceExpr.test(strValue)) { + strValue = strValue.replace(replaceExpr, ''); + if( strValue.length == 0) + return strValue; + } + + //check for leading & trailing spaces + replaceExpr = /^(\s*)([\W\w]*)(\b\s*$)/; + if(replaceExpr.test(strValue)) { + //remove leading and trailing whitespace characters + strValue = strValue.replace(replaceExpr, '$2'); + } + return strValue; + } + + function isEmpty( strValue ) { + + var strTemp = strValue; + strTemp = trimAll(strTemp); + if(strTemp.length > 0){ + return false; + } + return true; } \ No newline at end of file