title: Javascript onClick not working on Multiple Forms
body: <p>I have a dynamically generated form with some radio buttons.For each radio button there will be a <strong>onClick/onChange</strong> Function.</p>
  
  <p>The problem is that whenever radio button is clicked ,<strong>the onClick of the the first form radio button is called</strong>.</p>
  
  <pre><code>&lt;form name="a" id="a"&gt;
  &lt;input type="radio" name="radioa" onclick="func(1);"/&gt;
  &lt;input type="radio" name="radioa" onclick="func(2);"/&gt;
  &lt;/form&gt;
  .
  .
  &lt;form name="f" id="f"&gt;
  &lt;input type="radio" name="radiof" onclick="func(3);"/&gt;
  &lt;input type="radio" name="radiof" onclick="func(4);"/&gt;
  &lt;/form&gt;
  
  &lt;script&gt;
  function func(val){
  alert(val);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I tried with <strong>onchange</strong> function also its not working.
  Always the first form's radio button function is called and <code>alert(1)</code> is shown everytime.</p>
  
  <p>Any help is appreciated.
  Thanks in advance.</p>