title: Check all elements in form with Javascript
body: <p>I know javascript in the beginning level, but I have a problem.</p>
  
  <p>I have <strong>7</strong> input elements in a form and I want all of them to be filled. 
  I came up with this idea but it looks <strong>disgusting</strong>. </p>
  
  <p>Can someone help me how to check <strong>whether all form elements are filled or not?</strong></p>
  
  <pre><code>function validateForm()
  {
  var x=document.forms["register"]["name"].value;
  var y=document.forms["register"]["phone"].value;
  var z=document.forms["register"]["compname"].value;
  var q=document.forms["register"]["mail"].value;
  var w=document.forms["register"]["compphone"].value;
  var e=document.forms["register"]["adres"].value;
  var r=document.forms["register"]["zip"].value;
  if (x==null || x=="" || y==null || y=="" || z==null 
  || z=="" || q==null || q=="" ||  w==null || w=="" || e==null || e=="" 
  || r==null || r=="")
  {
  alert("Please fill all the inputs");
  return false;
  }
  }
  &lt;/script&gt;
  </code></pre>