Jump to content

Archived

This topic is now archived and is closed to further replies.

Garethp

Zend_Form_Element setting another elements attribute

Recommended Posts

Hey guys, I'm busy creating my own type of form element, just something that extends from Text in order to do some background stuff, and I was wandering how I can use that element to alter the attributes of another element. I was hoping for something like $this->getForm()->getElement('ElementName').setAttr('onClick', 'something'); but I couldn't find something similar to getForm() in the Zend API. Any help would be appreciated

Share this post


Link to post
Share on other sites

Ah, thanks. I ended up just passing the object in through a custom function, and just adding the attribute straight to the object

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.