Generate dropdown from value
<p>Hello javascript experts, I’ve been stuck on this code for few days with no idea how to fix it. I have a textfield where user can put in a value. When the value is submitted a number of dropdown lists will be generated by the inputted value. However I'm not too sure what went wrong with the code but it seems there is no response after you submit the value.</p>

<p>Following is my current code:</p>

<p>Javascript:</p>

<pre><code> &lt;script type="text/javascript"&gt;

function getvalue() {
 var number = document.getnumber.input.value;
 document.getElementById('result').value = number; 
}

function generatedropdown() {
 while (i &lt; number)
 {
     document.write
     (
     &lt;select name="list"&gt;
     &lt;option&gt;1&lt;/option&gt;
     &lt;option&gt;2&lt;/option&gt;
     &lt;/select&gt;
     );
     i++;
 }
  }

 &lt;/script&gt;
</code></pre>

<p>HTML:</p>

<pre><code> &lt;form name="getnumber"&gt;
Input number: &lt;input type="text" name="input"&gt;
&lt;input type="button" value="Next" onclick="getvalue()"&gt;
  &lt;/form&gt; 

&lt;form name="showdropdown"&gt;
Number entered: &lt;input type="text" id="result" readonly="readonly"&gt;
&lt;input type="button" value="Show lists" onclick="generatedropdown()"&gt;   
&lt;/form&gt;
</code></pre>

<p><strong>EDIT:</strong>
Sorry I'm a bit noobie at Javascript. I have moved <strong>function generatedropdown()</strong> to the body tags and now I get some feedback after submitting. However I'm still abit confuse in turning the string into a statement.</p>
