title: Get name of form element
body: <p>i have this simple JS for validating form, can someone tell me how to get name of field (you know, name=""), it should be where NameOfSomefield is now :S I tried with <code>someField.tagName</code> but no luck...</p>
  
  <pre><code>function validateForm(){
      var someField = document.forms["nameofofrm"]["someField"].value;
      if (someField==null || someField=="") {
          alert("You cannot leave blank this field: ".NameOfSomefield);
          return false;
      }
  }
  </code></pre>