Store dropdown as live variable?
<p>I've got the following PHP:</p>

<pre><code>&lt;?php
$default = 'Select a job role';
$query = "SELECT DISTINCT Job_Title FROM rates";

$result = mysql_query($query);

while($myrow = mysql_fetch_array($result)) {
$action = $myrow['Job_Title'];
echo "&lt;option value='$action'".($action == $default ? ' selected="selected"' : '')."&gt;$action&lt;/option&gt;\n";
}       
?&gt;
</code></pre>

<p>I need to store whatever they select from this dropdown as a variable.  Obviously if they change their choice it will keep changing the variable.</p>

<p>The reason behind this is I have another select statement whose results depend on the selection here. 
If it can't be done with just PHP then Jquery is the preference if needed.</p>

<pre><code>&lt;select name="job-role"&gt;
&lt;option value="J1"&gt;J1&lt;/option&gt;
&lt;option value="J2"&gt;J2&lt;/option&gt;
&lt;option value="J3"&gt;J3&lt;/option&gt;
&lt;/select&gt;
</code></pre>
