开发者

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'
));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜