What is wrong with this form validation?
<p>Basically, what I am trying to do is alert the same message if one of the seven text boxes in my form is empty. I have been playing around with it a lot, but now I am starting to feel exasperated; help! Sometimes I get a function validepiste() is not defined error and sometimes I don't get an error, but there is an alert even if all the boxes have something in them. I think the error might be due to an incorrect use of the || (or) operator, or the length bit. Here is the function (which is within the head tags):</p>

<pre><code>&lt;script type="text/javascript"&gt;
function validatepiste()
{
// all form fields must be filled in
var a= document.piste.nom.length;
var b= document.piste.email.length;
var c= document.piste.numtel.length;
var d= document.piste.adresse.length;
var e= document.piste.ville.length;
var f= document.piste.length;
var g= document.piste.travaux.length;
if (a||b||c||d||e||f||g==0){
  alert("Vous devez remplir toutes les cases.");
  return false;
  }
return true
} 
&lt;/script&gt;
</code></pre>

<p>And the call to that function which is in the html:</p>

<pre><code>&lt;input type="submit" name="Submit" value="Envoyer" onClick="return validatepiste()"/&gt;
</code></pre>

<p>Thank you!</p>
