javascript question
Posted: Thu Jul 08, 2004 12:29 am
hi guys, decided to use javascript for validation but once i click submit the error message pops up and then still carrys on to the proccess page. i need it to stop after the error message so the user can type in name again.
thanx!
thanx!
Code: Select all
var errormessage = ""
function validate_form()
{
errormessage = "You have the following errors:\n"
Name()
if (errormessage != "You have the following errors:\n")
{
alert(errormessage)
}
}
function Name()
{
var name = window.document.index.E_Name.value
if (name == "")
{
errormessage = errormessage + "- Please enter your name\n"
}
}