Avatar

Level 6

u can write using reg. exp. to remove spaces on left and right sides.

In this function strValue is FieldName.rawValue.

// Trims left and right blank spaces
function trim(strValue) {
return strValue.replace(/^\s+|\s+$/g,"");
}

u can also pass FieldName to that function but u have to get rawValue in the function

// Trims left and right blank spaces
function trim(fieldName) {
return fieldName.rawValue.replace(/^\s+|\s+$/g,"");
}

Hope this will help.

RAGHU.