wiredhosting
11-22-2008, 02:58 PM
validate name field in contact for
Hi to everybody!
we have our contact form redesigned by a coder, he is not available right now so we need your help on this slight issue..
the contact form works perfeclty. it validates every filed.. the problem is that the "name" field does not accept any blank space, so if you enter your first name its okey, but if you try to enter name + surname it gives error as if the name was wrong..
can someone help us with that?
here is the validation code..
Code:
function isAlphanumeric(elem, helperMsg){
var alphaExp = /^[0-9a-zA-Z]+$/;
if(elem.value.match(alphaExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
function isAlphabet(elem, helperMsg){
var alphaExp = /^[a-zA-Z]+$/;
if(elem.value.match(alphaExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
__________________Hosting
Hi to everybody!
we have our contact form redesigned by a coder, he is not available right now so we need your help on this slight issue..
the contact form works perfeclty. it validates every filed.. the problem is that the "name" field does not accept any blank space, so if you enter your first name its okey, but if you try to enter name + surname it gives error as if the name was wrong..
can someone help us with that?
here is the validation code..
Code:
function isAlphanumeric(elem, helperMsg){
var alphaExp = /^[0-9a-zA-Z]+$/;
if(elem.value.match(alphaExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
function isAlphabet(elem, helperMsg){
var alphaExp = /^[a-zA-Z]+$/;
if(elem.value.match(alphaExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
__________________Hosting
