I have a form named 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));
/* Form Elements & Other Definitions Here ... */
}
}
Now In controller action named viewDeviceAction() I have called this form as:
public function viewDeviceAction()
{
echo 'viewDevice: ';
$form_device=new Admin_Form_CreateDevice();
$form_device->setMethod('post');
$form_device->employee_name->addMultiOptions($aMembers);//here $aMembers is an array.
$this->view->form=$form_device;
}
Now I want following situation: On selecting any value from above dropdown a javascript function (which resides in viewDevice.phtml ) should be called.Like in general html as:
<select id="EmployeeId" onchange="loadDeviceId();">
So I just want to khow that how to implement the onchange event on the select element in zend framework