title: How can I change a form's input value with javascript
body: <p>How can I change a form's input value with javascript depending on witch combobox item is selected. I have a form with some imported values, and there is a field of witch imported value can be changed via a combobox. In my case:</p>
  
  <pre><code>print("&lt;input type='hidden' name='issue_array[{$issue["nr"]}][\"supplier\"]' value='{$issue["supplier"]}' /&gt;");
  </code></pre>
  
  <p>I have a combobox, that if I change it's value, should change the value of the input above.</p>
  
  <p>This is what I tried:</p>
  
  <pre><code>print("&lt;select name='supplier_combo' onchange='setSupplierInputValue(this.value, ${issue['nr']})'&gt;");
  </code></pre>
  
  <p>and the script:</p>
  
  <pre><code>  echo "\r\n" . '&lt;SCRIPT TYPE="text/javascript"&gt;' . "\r\n";
    echo 'function setSupplierInputValue(value, issue_nr)' . "\r\n";
    echo '{' . "\r\n";     
    echo '      issue_array[issue_nr]["supplier"] = value;';         
    echo '}' . "\r\n";     
    echo '&lt;/SCRIPT&gt;'. "\r\n"; 
  </code></pre>
  
  <p>But it doesn't work, please help.</p>