Zend_Form button submit elements registered javascript functions cant be found

andinand

New Member
I am playing around with registering simple alert(msg) functions with "onclick" events on several html divs. I tried pure html buttons, links, textfields... all work fine.I have tried it with Zend_Form textfields... works perfect.What does not work is buttons added to Zend_Form with createElement...I went through different scenarios... using jQuery and plain javascript... everyting works, but not buttons within Zend_Form.Any ideas why??Cheerios...EDIT:you asked for it :Doutside the form:\[code\]<button name="my_button" onclick="my_alert()">Click me</button>\[/code\]works, while (within A_Form extends Zend_Form):\[code\]$my_button = $this->createElement('button', 'my_button');$my_button->setLabel('Click me');$my_button->setAttrib('onclick', 'my_alert()');$this->addElement($my_button);\[/code\]produces proper html, but upon a call produces error msg "my_alert is not a function"... which does not make sense, since both are placed within the same html document
 
Top