title: problems calling javascript functions in input radio tags
body: <p>I am trying to change the value attribute in my input (type radio) when a different radio button is changed I would like to call a function and change the value being sent in the form:</p>
  
  <pre><code>&lt;table border ='1'&gt;
      &lt;tr&gt;
          &lt;th colspan='2'&gt;Thank You&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt; 
          &lt;td&gt;
              &lt;input type='radio' name='Choice' value=5 onchange="changeAmount('5');"&gt;
          &lt;/td&gt;
          &lt;td&gt;
              I
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;input type='radio' name='Choice' value=10 onchange="changeAmount('10');"&gt;
          &lt;/td&gt;                            
          &lt;td&gt;
              $10 
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;input type='radio' name='Choice' value=20 onchange="changeAmount('20');"&gt;
          &lt;/td&gt; 
          &lt;td&gt;
              $20
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;form action="insertPageHere" method="post" target="_top"&gt;   
  
  function changeAmount(value){
      if (value == 5)
      document.write("&lt;input type='hidden' name='amount' value='5'&gt;");
      else if (value == 10)
      document.write("&lt;input type='hidden' t' value='10'&gt;");
      else
      document.write("&lt;input type='hidden' name='t' value='20'&gt;");
  
  }
  &lt;/script&gt;
  
  
  &lt;/form&gt;
  </code></pre>
  
  <p>I'ved tried doing this with php and I had similar problems, if anyone can give me advance on how to get this work, that would be greatly appreciated thank you.</p>