Could you please help me rosolve my troubling matter. I used Zend_Form to create what I needed. However as I have relations many to many i decided to present multiple choices via checkboxes. Unfortunately range of these checkboxes depends on select field available in form.
I would like to change visible/availabe checkboxes depending on select option choosen.
I found that it should be possible to use javascript however I've got no idea how to take advantege of it in form based on Zend_Form.
Could you su开发者_StackOverflow中文版ggest possible solution?
Thank you in advance.
Kind Regards,
Add onchange attribute to the select like this
$form->addElement('select', 'select', array(
  'label'       => 'select',
  'multiOptions => array('zero', 'one'),
  'onchange'    => 'displayCheckboxes(this)'
));
After that implement a simple js function to display whatever you need
function displayCheckboxes(obj) {
  // js code here
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论