Hi,
Use unobstrusive javascript! (As someone on this forum pointed me out a
few months ago!).
Look in the source of your form to find the id of the individual radio, then
$this->view->addInlineScript("document.getElementById('individual_radio_id').onclick=function(){alert('clicked
radio ' + individual_radio_id');return true;};");
Dit not test this, so there may be a type mismatch somewhere. But it
should work.
Bart
nolner schreef:
Hi,
I have a group of 2 radio buttons - I simply want to reveal a set of
different fields dependent on which radio is clicked. I can add an onClick
handler as below - but it appears on both radio buttons - how can I add
different code to each?
$payment = new Zend_Form_Element_Radio('cust_paym_type', array(
'multiOptions' => array(
'AC' => 'Account Number ',
'CC' => 'Credit Card'),
'onClick' => "show_cc()"
));
thx
nolner schreef:
Hi,
I have a group of 2 radio buttons - I simply want to reveal a set of
different fields dependent on which radio is clicked. I can add an onClick
handler as below - but it appears on both radio buttons - how can I add
different code to each?
$payment = new Zend_Form_Element_Radio('cust_paym_type', array(
'multiOptions' => array(
'AC' => 'Account Number ',
'CC' => 'Credit Card'),
'onClick' => "show_cc()"
));
thx