I have a form called createDevice.php as:
class Admin_Form_CreateDevice extends Zend_Form { public function init() { $this->setName('Create Device Access'); $sort=new Zend_Form_Element_Select('employee_name'); $sort->setLabel('Employee Name:'); $this->addElements(array($sort)); } }
Now in a controller action called viewDeviceAction (), I called this form the following:
public function viewDeviceAction() { echo 'viewDevice: '; $form_device=new Admin_Form_CreateDevice(); $form_device->setMethod('post'); $form_device->employee_name->addMultiOptions($aMembers);
Now I want the following situation: If you select any value above the drop-down menu, you should call the javascript function (which is located in viewDevice.phtml). Generally html as:
<select id="EmployeeId" onchange="loadDeviceId();">
So, I just want how to implement the onchange event in the select element in zend framework
source share