<select> dropdown output my MYSQL data properly using JS function
<p>I have a JS/PHP piece of code that selects from a database, does some things with the ID's of the tables and outputs the data in a dropdown. </p>

<p>My JS currently appends <code>myfile.php?cat=X&amp;projectID=Y</code> correctly and i'm grabbing the variables correctly, but when I select the second dropdown it doesn't output the name, it only appends the ID to the title and variable..</p>

<pre><code>     function reload(form)
    {
    var val=form.cat.options[form.cat.options.selectedIndex].value;
    var val2=form.cat2.options[form.cat2.options.selectedIndex].value;
    self.location='add-recharge.php?cat=' + val + '&amp;projectID=' + val2;
    }
</code></pre>

<p>The PHP </p>

<pre><code>&lt;?

            @$cat=$_GET['cat'];
            if(strlen($cat) &gt; 0 and !is_numeric($cat)){  
            echo "Data Error";
            exit;
            }

            //MYSQL stuff


            echo "&lt;select name='cat' onchange=\"reload(this.form)\"&gt;&lt;option value=''&gt;Select a client&lt;/option&gt;";

                while($noticia2 = mysql_fetch_array($quer2)) { 
                 if($noticia2['clientID']==@$cat){echo "&lt;option selected value='$noticia2[clientID]'&gt;$noticia2[clientName]&lt;/option&gt;"."&lt;BR&gt;";}
                    else{echo  "&lt;option value='$noticia2[clientID]'&gt;$noticia2[clientName]&lt;/option&gt;";}
                }
                echo "&lt;/select&gt;";
                echo "&amp;nbsp;&lt;span class='req'&gt;&lt;img src='/images/essentialInput.png' alt='*' title='*' border='0' /&gt;&lt;/span&gt;";
                echo "&amp;nbsp; &amp;nbsp;&lt;span class='label'&gt;Project&lt;/span&gt;" . "&amp;nbsp;";
                echo "&lt;select name='cat2' onchange=\"reload(this.form)\"&gt;&lt;option value=''&gt;Select a project&lt;/option&gt;";

                while($noticia = mysql_fetch_array($quer)) { 
                    echo  "&lt;option value='$noticia[projectID]'&gt;$noticia[projectName]&lt;/option&gt;";
                }
                 echo "&lt;/select&gt;";
                 echo $intClientID;
                 //echo "&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;";   
       ?&gt;
</code></pre>

<p>How do I get it to update it with projectName and not reload with 'Select project' ?</p>
