title: automatically change php form row value by changing another row value
body: <p>I have a ticketing support system and I have some rows when in <code>call_edit.php</code> file. I have two rows called <code>staff</code> and <code>status</code>. When someone send us a ticket, the ticket status by default is <code>open</code> and the staff row is empty (<code>0</code> in my code). I want that when I change the staff value from empty (<code>0</code> in my code) to a name (<code>kitty</code>, <code>John</code> or something else), the status automatically changes from <code>open</code> to <code>Checking</code>.</p>
  
  <p><strong>This is my php form</strong>:</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td valign="top" style="width: 150px;"&gt;Status&lt;/td&gt;
      &lt;td&gt;
          &lt;select name='call_status'&gt;
              &lt;option value='0'&lt;?php if($site_calls-&gt;call_status == 0){echo ' selected';}?&gt;&gt;Open&lt;/option&gt;
              &lt;option value='2'&lt;?php if($site_calls-&gt;call_status == 2){echo ' selected';}?&gt;&gt;Checking&lt;/option&gt;
              &lt;option value='1'&lt;?php if($site_calls-&gt;call_status == 1){echo ' selected';}?&gt;&gt;Closed&lt;/option&gt;
              &lt;option value='3'&lt;?php if($site_calls-&gt;call_status == 3){echo ' selected';}?&gt;&gt;Deleted&lt;/option&gt;
          &lt;/select&gt; 
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;Staff&lt;/td&gt;
      &lt;td&gt;
          &lt;select name='call_staff'&gt;
              &lt;option value="0"&gt;&lt;/option&gt;
          &lt;?php $staff_name = $db-&gt;get_results("select user_id,user_name from site_users where user_level&lt;&gt;1 order by user_name;");
          foreach ($staff_name as $staff )
          {?&gt;
              &lt;option value='&lt;?php echo $staff-&gt;user_id;?&gt;'&lt;?php if($staff-&gt;user_id == $call_staff){echo ' selected';}?&gt;&gt;
                  &lt;?php echo $staff-&gt;user_name;?&gt;          
              &lt;/option&gt;
          &lt;?php } ?&gt;
          &lt;/select&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>