Re: quickform : setChecked doesn't work
| From: | Charly Pache | Date: | Tue, 17 Feb 2009 19:54:19 +0000 |
| Subject: | Re: quickform : setChecked doesn't work | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-29699@lists.php.net to get a copy of this message | ||
The problem with the code in my previous post is that if you have a
multi-page form and this radio group on the first, then when you will go
back from page 2 to 1 for example, the value of the group will be set to
'val1', even if you clicked 'val2'..so we have to test whether it is already
set or not, just replace:
"
$form->_submitValues['grp_name'] = 'val1';
"
by
"
if(!isset($form->_submitValues['grp_name']))
$form->_submitValues['grp_name'] = 'val1';
"
..and yeah, it's not nice to access variables that are meant to be private
but there is really an issue with this 'checked' setting for radio buttons.
--
View this message in context: http://www.nabble.com/quickform-%3A-setChecked-doesn%27t-work-tp8055856p22065027.html
Sent from the Pear - General mailing list archive at Nabble.com.