Hi,
Can someone tell me what's wrong with this code that it's not working:
Thans a bunch,
Can someone tell me what's wrong with this code that it's not working:
Code:
<script type="text/javascript">
function validateForm(){
stripSpaces(frm)
function stripSpaces(frm) {
var x = frm.email.value;
frm.email.value = (x.replace(/^\W+/,'')).replace(/\W+$/,'');
var z = frm.Message.value;
frm.Message.value = (z.replace(/^\W+/,'')).replace(/\W+$/,'');
}
if (document.form1.email.value ==""){
alert ("Please enter your email.");
document.form1.email.focus();
return false;
}
if (document.form1.Message.value == ""){
alert("Please enter your message.");
return false;
}
return true;
}
</script>
Thans a bunch,