Sorry for being so late.
It start working fine. But after that I try to add the email validation function, and right after adding the function it just not working. And if I take the e-mail validation function out it start working again. I'm pasting the codes here please let me know what's wrong in there thank you:
function validEmail(email)
{
invalidChars = " /:,;"
if (email == "")
{
return false
)
for (i=0; i<invalidChars.length; i++)
{
badChar = invalidChars.charAt(i)
if (email.indexof(badChar,0) > -1)
{
return false
}
}
atPos = email.indexOf("@",1)
if (atPos == -1)
{
return false
}
if (email.indexOf("@", atPos + 1)
{
return false
}
periodPos = email.indexOf(".", atPos)
if (periodPos == -1)
{
return false
}
if (periodPos+3 > email.length)
{
return false
}
return true
}
And now I'm calling the e-mail validation function here:
function checkFields(confirm_form)
{
if (!validEmail(confirm_form.emailAddr.value))
{
alert(Invalid eamil address");
confirm_form.emailAddr.focus();
confirm_form.eamilAddr.select();
return false;
}
return true
}