Re: QuickForm_Controller and Smarty, session error

From: Date: Thu, 24 Jun 2004 20:22:14 +0000
Subject: Re: QuickForm_Controller and Smarty, session error
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13317@lists.php.net to get a copy of this message
Bertrand Mansion wrote:
Trevan Devaun Richins wrote:
This is how I build my radio buttons. I use an external array that has the information of the radios (in $element_data). Then, I just loop through it and place it in a group. $element_data['enabled'] = 'enabled'; $element_data['disabled'] = 'disabled'; $element_data['radio_group']['locked'] = 'locked'; foreach($element_data['radio_group'] as $radio_value) { $radio_button[] = HTML_QuickForm::createElement('radio',null,null,null,$radio_value,null); } return HTML_QuickForm::createElement('group',$radio_button,'status',null,'');
Try: $radio_button[] =& HTML_QuickForm::createElement('radio',null,null,$radio_value,$radio_value); Use an ampersand in front of your function name as well in order to keep the reference to the created elements/groups. Bertrand Mansion Mamasam Thanks for the reply, I modified my code with the ampersand but the error is still there. The HTML for the radio boxes are outputted correctly as:
<input value="enabled" type="radio" id="qf_a09337" name="status" /><input value="disabled" type="radio" id="qf_b69b0a" name="status" checked="checked" /><input value="locked" type="radio" id="qf_746c7b" name="status" /> Where disabled is checked on this example. But if you load up the page, it will first display disabled as checked, and after you reload the page (not a hard reload), the locked option becomes selected. It happens EVERY time you reload it for the first time, yet the HTML looks fine. This error only occurs when it is being used with HTML_QuickForm_Controller. Plus, when you delete the session cookie that Controller creates, it will start the process over again. The HTML, though, looks fine, and there is no javascript. The error is duplicated at http://students.cs.byu.edu/~tdr32/LDAP_Admin/LDAP_Admin/. Thanks for the help. I am trying to just delet unnecessary stuff to find the error. Trevan

« previous php.pear.general (#13317) next »