Problem with variable
<p>I am trying to fetch value of dropdown menu having id="childrestrictionselect" in javascript variable childrestrictid. Whats the problem with my code? Even if I try to alert msg"HI" its going well but not working for drop down menu.</p>

<pre><code>function restrictioninsert() {
document.getElementById('childrestriction').innerHTML = "Just a second...";
var childrestrictid = encodeURI(document.getElementById("childrestrictionselect").value);
//var childrestrictid= "HI";
alert(childrestrictid);}
</code></pre>

<p>Please help I am new with JavaScript.</p>

<p>Respective HTML code.</p>

<pre><code>&lt;select id="childrestrictionselect" onchange="javascript:restrictioninsert()"&gt;
&lt;option value=""&gt;Select Child&lt;/option&gt;
&lt;?php while($result=mysql_fetch_assoc($child)){
print '&lt;option value="'.$result["snum"].'"&gt;'.$result["sfname"].'&lt;/option&gt;'; }?&gt;
&lt;/select&gt;
</code></pre>

<p>Edited program ended after <code>innerHTML</code>. I am getting just a second message on screen.</p>
