Re: QF: exportValue() and silly error possibly ....
| From: | Alexey Borzov | Date: | Tue, 16 Dec 2003 08:24:13 +0000 |
| Subject: | Re: QF: exportValue() and silly error possibly .... | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9548@lists.php.net to get a copy of this message | ||
Hi!
Massimiliano Bariola wrote:
In the first of them, I declare and add to form a radiobutton group as follows, in its buildForm method .... $radioGroup[] = &HTML_QuickForm::createElement('radio', 'stato', null, 'Attiva', 'Attiva'); $radioGroup[] = &HTML_QuickForm::createElement('radio', 'stato', null, 'Disattiva', 'Disattiva'); $this->addGroup($radioGroup, null, 'Stato della Licita', ' '); .... blah blah blah In the second submit method (meant to just save the contents of the active page and go back to it), I try to get the values of the elements to save (radiobutton group included) in the following way(s): $page->exportValue('stato')); $page->controller->exportValue('relevantPage', 'stato'); but I get back a HTML_QuickForm_Error telling me that the element does not exist.And it does not exist indeed. You have a group with empty (in fact it's not empty, but autogenerated) name that contains some other elements. Try: $radioGroup[] = &HTML_QuickForm::createElement('radio', null, null, 'Attiva', 'Attiva'); $radioGroup[] = &HTML_QuickForm::createElement('radio', null, null, 'Disattiva', 'Disattiva'); $this->addGroup($radioGroup, 'stato', 'Stato della Licita', ' ');