title: Changing one form value based on onChange of another with javascript
body: <p>I can't seem to get this function to work out. I'm trying to change the "business" input value of my form based on an amount selected in the "amount" dropdown. What am I missing!!! I've been trying this for an hour.</p>
  
  <pre><code>  &lt;script type="text/javascript"&gt;
    function chPy()
    {
    var businessvar = "paypals@ramatico.com";
    if (document.forms['5'].amount.value &gt; 11){
    businessvar = "paypall@ramatico.com"
    }
    document.forms['5'].business.value = businessvar;
    }
    &lt;/script&gt;
  
    &lt;form name="5"&gt;
    &lt;select name="amount" OnChange="chPy()"&gt;
        &lt;option value="na"&gt;Select&lt;/option&gt;
        &lt;option value="1.00"&gt;$1&lt;/option&gt;
        &lt;option value="5.00"&gt;$5&lt;/option&gt;
        &lt;option value="10.00"&gt;$10&lt;/option&gt;
        &lt;option value="15.00"&gt;$15&lt;/option&gt;
        &lt;option value="20.00"&gt;$20&lt;/option&gt;
        &lt;option value="25.00"&gt;$25&lt;/option&gt;
    &lt;/select&gt; 
    &lt;input name="business" type="text" value=""&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>Ok. The next step. I have about 100 of these forms on a page. Instead of creating one for each form, I'd like to have one script that changes based on which form is being changed with "onChange". Each of the forms on the page have values of the same name (but not ID) (they are for paypal). I think it will be ok if I can change the"formname" in the following: "document.forms['formname']" based on a variable populated by something like chPy("formname") etc..... I can't seem to get that to work either.</p>