title: Update input field when the value of a select changes?
body: <p>Update input field event <code>onchange</code>?</p>
  <pre><code>$A = array(A,B,C,D);
  
  &lt;select name=&quot;A&quot; id=&quot;A&quot; onchange=&quot;change_val()&quot;&gt;
  &lt;?php 
  foreach($A as $key=&gt;$val){?&gt;
      &lt;option value=&quot;&lt;?php echo $key?&gt;&lt;?php echo $val?&quot;&gt;&lt;/option&gt;
  &lt;?php }?&gt;
   &lt;/select&gt;
  &lt;input name=&quot;seleted_value&quot; id=&quot;seleted_value&quot; value=&quot;Hello first time&quot; &gt;
  </code></pre>
  <p>I want to write a <code>onchange</code> method <code>change_val()</code> that do this task:</p>
  <p>if select A ( by default ) show value  'Hello first time' into input field <code>seleted_value</code></p>
  <p>else show value have selected into input field <code>seleted_value</code> AND <code>Disable this input field for read only.</code></p>
  <p>Anybody could guide me how to do this?</p>
  <pre><code>  if selected= A =&gt;show 'Hello first time'
    if selected= B =&gt;show 'B'
    if selected= C =&gt;show 'C'
    if selected= D =&gt;show 'D'
  </code></pre>