You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
408 B
Java
17 lines
408 B
Java
5 years ago
|
Java Script Trim() function
|
||
|
|
||
|
function fnTrim() {
|
||
|
for(var L=0; L if(this.charAt(L)!=" ")break;
|
||
|
for(R=this.length-1; R>=0;R--)
|
||
|
if(this.charAt(R)!=" ")break;
|
||
|
if(L==this.length)return "";
|
||
|
return this.substring(L,R+1);
|
||
|
}
|
||
|
String.prototype.trim=fnTrim;
|
||
|
//**** For trim the crtl
|
||
|
|
||
|
if ((document.frm.crtlName.value).trim()=="") {
|
||
|
//*** Here ur code
|
||
|
|
||
|
}
|