hey,
for trim text in javascript try following
if (txtSSAETitle.value.replace(/^\s+|\s+$/g, "") == "" || txtSSAETitle.value.replace(/^\s+|\s+$/g, "") == "") {
txtSSAETitle.focus();
alert("AE title should not be blank.");
return false;
}
Hope it will Help u
Best Luck
happy Coding
:)