title: Jquery - Fill an input text when select option
body: <p>I have this form's elements:</p>
  
  <pre><code>&lt;form ...&gt;
      &lt;select name="type[]" id="type[]"&gt;
          &lt;option value="1"&gt;One&lt;/option&gt;
          &lt;option value="2"&gt;Two&lt;/option&gt;
      &lt;/select&gt;
      &lt;input type="text" name="tvalue[]" id="tvalue[]" /&gt;
  
      &lt;select name="type[]" id="type[]"&gt;
          &lt;option value="1"&gt;One&lt;/option&gt;
          &lt;option value="2"&gt;Two&lt;/option&gt;
      &lt;/select&gt;
      &lt;input type="text" name="tvalue[]" id="tvalue[]" /&gt;
      ...
  
      &lt;input type="submit" value="send" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>so, I need fill the input text element when select option element change.
  (array of elements?)
  can anybody help me, please?</p>
  
  <p>The markup above is result of this PHP script (I changed the markup above):</p>
  
  <pre><code>&lt;?php
  echo "&lt;form name='form1' id='form1' action=\"#\" method='post'&gt;";
  for ($i=0; $i&lt;5; $i++){
  echo "&lt;select name='type[]' id='type[]'&gt;\n";
  echo "&lt;option value ='1'&gt;One&lt;/option&gt;\n";
  echo "&lt;option value ='2'&gt;Two&lt;/option&gt;\n";
  echo "&lt;/select&gt;\n";
  echo "&lt;input type='text' name='tvalue[]' id='tvalue[]' value=''&gt;";
  }
  echo "&lt;input type='submit' name='submit' id='submit' value='enviar' /&gt;";
  echo "&lt;/form&gt;";
  ?&gt;
  </code></pre>
  
  <p>(type[] and tvalue[] because of I ned post this an array)</p>
  
  <p>The problem is that I need fill the input text when I select option.
  For example, when I select option "One" in the first select, then the first input text 
  must show "One", and so when I select an option in the second select, and the third, and so...
  So when I submit the form I can get this values.</p>
  
  <p>Thanks you very much!
  Carlos.</p>