Display options values from 2 dropdown menus in Textbox?
<p>I have an array in Javascript</p>

<pre><code>var values = [1, 2, 0.1, 1, 3, .2, 2, 3,.3];
</code></pre>

<p>and another array that shows the text for each int:</p>

<pre><code>var names = [1, 'X', 2, 'Y', 3, 'Z'];
</code></pre>

<p>I already converted this to a hash map like this:</p>

<pre><code>hash = {(1,2): 0.1, (1,3): .2, (2,3): .3}
</code></pre>

<p>I needed to convert <code>values</code> to a <code>hash</code> because I have 2 dropdown menus and a textbox that displays a value depending on the 2 values the user chooses from the dropdown menus</p>

<p>This is what I have created so far: <a href="https://plnkr.co/edit/g89r9TdIzJFxc3r5u8h9?p=preview" rel="nofollow">https://plnkr.co/edit/g89r9TdIzJFxc3r5u8h9?p=preview</a></p>

<p>However, I now want the corresponding letter value from the <code>names</code> array to show in the textbox. As can be seen in the link, <code>Z</code> appears in the 1st and 3rd textboxes, instead of <code>X</code> for each. I want the 1st and 3rd textboxes to show the letters from the 2 dropdown menus. So if the 1st choice is <code>X</code> and the 2nd <code>Y</code>, then the 1st textbox should show <code>X</code> and the 3rd textbox should show <code>Y</code></p>

<p>How do I do this?</p>