title: onsubmit="return checkform(this);" seems to be empty for my form
body: <p>When I click Submit, I get an error that the value is undefined in my javascript that I use to validate my form for the aForm.propertyid.  </p>
  
  <p>I'm thinking this is related to using a select and trying to verify a value was chosen, as I've not validated against a select before and my other forms all work fine.  </p>
  
  <p>The correct values are in the $_POST in lease_edita, but the checkForm(this) doesn't seem to pass anything to the javascript for validation - my checkForm(aValue) didn't get aValue.</p>
  
  <p>I added an alert in my checkForm to display the value for error checking, and it's not getting a value.  The onchange="checkProperty(this.value);" works correctly though and does get a value.</p>
  
  <p>propertyid is undefined @/lease_jsLibrary.js</p>
  
  <p>I'm hoping I'm posting enough code... I've been working on this for 2 days without finding a fix, and am hopeful for suggestions or ideas.</p>
  
  <p>The form:
      </p>
  
  <pre><code>&lt;form name ="addEditLeaseForm" id="addEditLeaseForm" action="lease_edita.php" method="post" onsubmit="return checkForm(this)"&gt;
  &lt;?php
  $output = &lt;&lt;&lt;HTML
      &lt;table class="center1" width="500"&gt;
          &lt;tr&gt;
              &lt;td style="text-align: right; "&gt;
              Property:
              &lt;/td&gt;
              &lt;td&gt;
              &lt;select name="propertyid" id="propertyid" stle="width:270px;" onchange="checkProperty(this.value);" /&gt;
                  &lt;option value='' selected&gt;&lt;/option&gt;
  HTML;
                  $propList = getPropertyList();  // get the properties to populate the list box
                  foreach ($propList as $aProperty) {
                  extract($aProperty);
                  $output .= &lt;&lt;&lt;HTML
                  &lt;option value="$idproperty"
  HTML;
                  if ($idproperty == $prop_id) {
                  $output .= &lt;&lt;&lt;HTML
   selected
  HTML;
              }
                  $output .= &lt;&lt;&lt;HTML
  &gt;$address&lt;/option&gt;
  HTML;
              }
                  $output .= &lt;&lt;&lt; HTML
              &lt;/select&gt;
              &lt;font id="propertyErr" style="visibility: hidden; color:red; font-weight: bold;"&gt;*Required&lt;/font&gt;
  
              &lt;/td&gt;
          &lt;/tr&gt;
  HTML;
      echo $output;
  ?&gt;
      &lt;tr&gt;
      &lt;td colspan ="2" align="center"&gt;
           &lt;input type="submit" value="&lt;?php echo $buttontext ?&gt;" /&gt;
          &lt;input type="button" name="Cancel" value="Cancel" onClick="history.go(-1);return true;" /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;/table&gt;
  &lt;/form&gt;
  
  &lt;p style="text-align: center"&gt;
      &lt;input type="button" name="Property" value="Back to Property" onclick="window.location = '../property/property_main.php' " /&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>lease_jsLibrary.js contents:</p>
  
  <pre><code>function trim(strToTrim) {
      "use strict";
      //create a regular expression literal to identify leading and trailing spaces
      var reg = /^\s+|\s+$/g;
      //use the string method - replace - to remove leading and trailing spaces
      return strToTrim.replace(reg,"");
  }
  
  // checks whether an input control is empty (i.e., the user failed to enter a required input)
  // note: it uses the trim method (see above) to eliminate white spaces before checking the input
  function isEmpty(aControl) {
      return (trim(aControl.value).length == 0) ? true : false;
  }
  
  // checks for invalid characters in a string
  function hasInvalidChars(aControl) {
      //create a regular expression literal to identify invalid characters
      var reg = /[^a-zA-Z0-9\s\&amp;\!\?\.',_-]/;
      //use the regular expression method - test - to check whether the string contains invalid characters
      return reg.test(trim(aControl.value));
  }
  
  // removes starting and trailing white spaces
  function trimBlur(strToTrim) {
      "use strict";
      //create a regular expression literal to identify leading and trailing spaces
      var reg = /^\s+|\s+$/g;
      //use the string method - replace - to remove leading and trailing spaces
      return strToTrim.replace(reg, "");
  }
  
  // checks whether an input control is empty (i.e., the user failed to enter a required input)
  // note: it uses the trim method (see above) to eliminate white spaces before checking the input
  function isEmptyBlur(aControl) {
      "use strict";
      return (trimBlur(aControl).length === 0) ? true : false;
  }
  
  function checkProperty(aValue) {
      "use strict";
  alert(aValue);
      if (isEmptyBlur(aValue)) {
      document.getElementById("propertyErr").style.visibility='visible';
      document.getElementById("propertyid").style.borderColor='#FF3300';
      document.getElementById("propertyErr").innerHTML="*Required";
      return false;
      } else {
      document.getElementById("propertyErr").style.visibility='hidden';
      document.getElementById("propertyid").style.borderColor='';
      return true;
      }
  }
  
  function checkForm(aValue) {
      alert (aValue.propertyid);
      if (isEmpty(aValue.propertyid)) {
      document.getElementById("propertyErr").style.visibility='visible';
      document.getElementById("propertyid").style.borderColor='#FF3300';
      document.getElementById("propertyErr").innerHTML="*Required";
      return false;
      } else return true;
  }
  </code></pre>
  
  <p>thanks in advance for tips, suggestions, and ideas.. </p>
  
  <p>this is fixed by changing to use:
      if (isEmpty(aValue.propertyid.value))
  thank you!!!</p>