calling Jquery from PHP
<p>having trouble calling a Jquery function from within PHP. I'm getting a syntax error when I'm using the below code:</p>

<pre><code>if(!empty($_POST['selectAGE'])){
     $username = $_POST['selectAGE'];
}

if(empty($_POST['selectAGE'])){
   echo '&lt;script type="text/javascript"&gt;'
   ,  '$("#selectAGE").prepend("&lt;option value=''&gt;&lt;/option&gt;").val('');'
   , '&lt;/script&gt;';
}
</code></pre>

<p>Am I not escaping properly or something?</p>

<p>further to this, I'm then checking this select box by using </p>

<pre><code>if ( form.selectAGE.selectedIndex == 0 ) { alert ( "Enter the correct Age." ); return false; }
</code></pre>

<p>however, once the form has been submitted, it eliminates the prepended 'empty' value and now the one you've selected is selectedindex 0. so the above check returns that you haven't entered it. How can I amend the line above to take this into account?</p>
