They probably chose not to allow you to use the onclick tag for this because
it is not good standards to use inline javascript.  I am also sure they
would advise against using style="" as well.
Another question is why do you even need to use javascript?  If you have two
buttons one has a value of submit, and the other cancel.  When you process
the form can't you just check to see which one was clicked just like you
would with any php form and not need the javascript at all?

$cancel = new Zend_Form_Element_Submit("Cancel");

if ($this->getRequest()->isPost() &&
$this->getRequest()->getParam('Cancel')=='Cancel'){
       redirect to whatever when cancel is clicked
}

On Tue, Oct 6, 2009 at 3:43 PM, vinnyman <vboisv...@simexperts.com> wrote:

>
> From my understanding, you'll have to use an onchange event at the higher
> level and inspect which option is selected in the corresponding javascript
> function (not provided here, sorry for being lazy).
>
> Something of the likes of :
>
>      advertiser.broadcast.elements.broadcastRecipientsRadio.onchange =
> "goZendgo()"
>
> I personally find it lame that you cannot assign a function to an onclick
> event directly in the option tag ... That whole Zend_Form structure is a
> mess.  Matthew O'Phinney et al. should have thought it through.
> --
> View this message in context:
> http://www.nabble.com/Form-from-INI-multiOptions-tp22568875p25775365.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to