13
rated 0 times
[
20]
[
7]
/ answers: 1 / hits: 46629
/ 13 Years ago, mon, november 14, 2011, 12:00:00
Hello so i'm trying to trim the white spaces when the user enter spaces he get an error explaning that he should enter valid chars but if he used: ' test '
the same value is entered in the database do i need to trim that again in javascript ?
function validateForm()
{
if(trim(document.insert.aname.value) ===)
{
alert(Animal should have a name);
document.insert.aname.focus();
return false;
}
}
function trim(value) {
return value.replace(/^s+|s+$/g,);
}
please can you help ?
the input page is .JSP
More From » validation