Zend framework and jquery - attach server side event?

I have a form that I created using Zend_Form (or Zend_JQuery_Form now).

I have a select box on the form, and I would like to make a callback on the server when the user selects a value (to create dependent select boxes).

Can I specify the event code to change from the server? or just write client side jquery yourself?

Thanks.

+1
source share
1 answer

Yes. This can be added to the server side. When creating a form element, add data for the onchange event, as shown below.

 $titleElement = $form->createElement('text', 'title', array( 'onchange' => 'alert(this.value);' 'label' => 'This is the title' )); 
0
source

Source: https://habr.com/ru/post/1388141/


All Articles