[thelist] wehavethewayout.com

David Kutcher david_kutcher at hotmail.com
Thu Apr 4 10:44:03 CST 2002


<script language="JavaScript" type="text/javascript">
function validateForm()
{
 var theForm = document.memberApp;
 var fname = theForm.firstName;

 // make sure something is entered in First Name field
 if (fname.value=="")
 {
  alert("Please fill in your first name.");
  fname.focus();
  return false;
 }
}
</script>

<form action="form-submit.php" method="POST" name="memberApp"
onSubmit="return validateForm()">

Just one example.  This is also easily turned into an array so that the size
of the validation code is minimal.

By having javascript turned off, you're wasting more of your time as well as
the time of other people that are requesting information from the server
that is slowed down by your continual requests that generate error
responses.

David
www.confluentforms.com


----- Original Message -----
From: "PeterV" <peter at poorbuthappy.com>

>  For complex forms in which
> they may typically have a number of fields wrong, I'd recommend server
side
> validation only, since it allows you to nicely present the problems,
> instead of them having to go and find the wrong fields in the form (if its
> a long form).
> Peter




More information about the thelist mailing list