Javascript: how to insert value into text input fields from a drop down menu
<p>I am pretty new to javascript so I hope someone here can help me out with this little task.</p>

<p>I currently have two input text fields that I need to be populated with text after selecting an option from a drop down menu.</p>

<p>For example...</p>

<p>I have a select field that looks like this:</p>

<pre><code>&lt;select id="select_2" onchange="insertProduct(2);"&gt;
</code></pre>

<p>And within that select I have options that look like this:</p>

<pre><code>&lt;option id="cdrom001" title="my cdrom"&gt;cdrom001 - my cdrom&lt;/option&gt;
&lt;option id="DVD-ABUG" title="A Bug's Life"&gt;DVD-ABUG - A Bug's Life&lt;/option&gt;
&lt;option id="DVD-BELOVED" title="Beloved"&gt;DVD-BELOVED - Beloved&lt;/option&gt;
....
</code></pre>

<p>What I want to happen, is when I select an option from that drop down list, I want my text input field #1 to be populated with the option id (eg. DVD-ABUG) and I want my text input field #2 to be populated with the option title (eg. A Bug's Life).</p>

<p>Here is the code for my two text input fields:</p>

<pre><code>&lt;input type="text" name="model[]" id="model_2"&gt;
&lt;input type="text" name="product[]" id="product_2"&gt;
</code></pre>

<p>I have this much written of the function that will be required to do this...</p>

<pre><code>function insertProduct(id){ 
// code goes here
}
</code></pre>

<p>As you can see, I don't have much. :o)</p>

<p>Can someone please help me with the function that can do this?</p>

<p>Thanks so much!</p>
