title: Zend_Form button submit elements registered javascript functions cant be found
body: <p>I am playing around with registering simple <code>alert(msg)</code> functions with <code>onclick</code> events on several HTML divs. I tried pure HTML buttons, links, textfields, and they all work fine.</p>
  <p>I tried it with Zend_Form textfields and it works perfectly.</p>
  <p>What does not work is buttons added to Zend_Form with <code>createElement</code>.</p>
  <p>I went through different scenarios, like using jQuery and plain JavaScript, and everything works, but not buttons within Zend_Form.</p>
  <p>Any ideas why?</p>
  <h3>EDIT:</h3>
  <p>Outside the form:</p>
  <pre><code>&lt;button name=&quot;my_button&quot; onclick=&quot;my_alert()&quot;&gt;Click me&lt;/button&gt;
  </code></pre>
  <p>works, while</p>
  <p>(within A_Form extends Zend_Form):</p>
  <pre><code>$my_button = $this-&gt;createElement('button', 'my_button');
  $my_button-&gt;setLabel('Click me');
  $my_button-&gt;setAttrib('onclick', 'my_alert()');
  $this-&gt;addElement($my_button);
  </code></pre>
  <p>produces proper HTML, but upon a call produces error msg &quot;my_alert is not a function&quot;, which does not make sense, since both are placed within the same HTML document.</p>