title: onChange="document.myform.submit() and PHP while loop
body: <p>I have the following code and on it's own works fine, but I need to have it in a PHP while loop as there may be hundreds of records. This does not work, meaning it does not submit the form.</p>
  
  <p>Any help with this code, or other ideas that will work are appreciated. It also needs to write to a mysql DB the new value. Please note that I am less than a newbie with javascript.</p>
  
  <p>Thanks</p>
  
  <pre><code>&lt;form action="home.php" method="post" name="status"&gt;
      &lt;input type="hidden" name="record_number" value="&lt;? echo $r['record_number']; ?&gt;"&gt;
      &lt;input type="hidden" name="submit" value="cstatus"&gt;
      &lt;select name="statuscode" type="dropdown" style="font-size: 8pt; width: 60px" onChange="status.submit();"&gt;
          &lt;? if($r['statuscode']) { echo "&lt;option value='".$r['statuscode']."'&gt;".$r['statuscode']."&lt;/option&gt;"; } ?&gt;
          &lt;option value='Open'&gt;Open&lt;/option&gt;      
          &lt;option value='Closed'&gt;Closed&lt;/option&gt;
          &lt;option value='Pending'&gt;Pending&lt;/option&gt;        
          &lt;option value='Cancelled'&gt;Cancelled&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>