zend framework and jquery - attach event from server side?
I have a form I created with Zend_Form
(or Zend_JQuery_Form
now).
I have a select box in the form and I would like to do a call-back to the server when the user selects a value (to create dependent select boxes).
Is there any way to specify the "change" event code from the server side? or just to write the 开发者_开发问答jquery client side myself?
Thanks.
Yes. That is possible to add in the server side itself. While creating your form element, add the details for the onchange event like shown below.
$titleElement = $form->createElement('text', 'title', array(
'onchange' => 'alert(this.value);'
'label' => 'This is the title'
));
精彩评论