Hey everyone
I am working with ZF 1.6.2 and I'm trying to select something from one
select element and then enable a second select element.
I tried it as follows, but there are two problems. First of all go() does
not know $fach2 and if I try to simply echo a random number it shows this
one already when loading the page and does not change it when changing the
select value. Can anyone help me with this? I would rather not try it with
JavaScript, but if there is no other solution, please post this one, too.
Thanx!
function go()
{
$fach2->disable = true; //does not know $fach2
//echo random number
//srand();
//echo rand();
}
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('enctype', 'multipart/form-data');
$this->setName('upload_form');
$fach = new Zend_Form_Element_Select('fach');
$fach->setLabel("Fach:")
->setName('fach')
->setAttrib('id', 'fach')
->setAttrib('onChange', $this->go());
$fach2 = new Zend_Form_Element_Select('fach2');
$fach2->disable = true;
$fach2->setLabel("Fach2:")
->setName('fach2')
->setAttrib('id', 'fach2');
$this->addElements(array($fach, $fach2));
}
Would be great if someone could help me. Thanx
Mantz
--
View this message in context:
http://www.nabble.com/Trouble-with-on-Change-in-Zend_Form_Element_Select-tp20383280p20383280.html
Sent from the Zend Framework mailing list archive at Nabble.com.