form name fields---HTML question

Status
Not open for further replies.

sookaa

Ars Tribunus Militum
2,103
In an HTML form , I am performing rudimentary validation to make sure email address' are in proper format etc. If I name the form field "clientEmail" for example and the validation script returns an error to the user, it says something like "clientEmail uis required"

Is there a way to make this more "friendly" for example, have the script output "Sorry, but you must enter your email address"

cheers

sookaa
 

MrCatbert

Ars Tribunus Angusticlavius
9,107
Subscriptor
Assuming you are using JavaScript it would look something like this...
code:<HR>
Code:
      if (document.yourformnamehere.ClientEmail.value == "")
      {
         OKSoFar = false
         alert("Please fill in your email address.")
         document.yourformnamehere.ClientEmail.focus()
      }<P>      if (OKSoFar == true)
      {
         document.yourformnamehere.submit()
      }
 
Status
Not open for further replies.