#23191 [Opn->NoF]: [QuickForm] Select box type problems

From: Date: Tue, 15 Apr 2003 16:02:11 +0000
Subject: #23191 [Opn->NoF]: [QuickForm] Select box type problems
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15182@lists.php.net to get a copy of this message
ID: 23191 Updated by: mansion@php.net Reported By: jellybob@php.net -Status: Open +Status: No Feedback Bug Type: PEAR related Operating System: Debian 3.0 PHP Version: 4.3.1 New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. Previous Comments: ------------------------------------------------------------------------ [2003-04-14 02:16:57] mansion@php.net I have tested with this code and it was working fine. require_once('HTML/QuickForm.php'); $form = new HTML_QuickForm(); $select =& $form->addElement('select', 'bob'); $select->addOption('option1', '1'); $select->addOption('option2', '2'); $form->addElement('submit', null, 'Submit'); if ($form->validate()) { print_r($form->getElementValue('bob')); } $form->display(); Could you tell me which QuickForm release you are using ? Thanks, Bertrand Mansion Mamasam ------------------------------------------------------------------------ [2003-04-13 20:50:14] jellybob@php.net When using a select element in a Quickform, if you later try to retrieve the value with getElementValue, it returns it as the string Array (not as an Array, but just the string). Example: $form = new HTML_QuickForm('example', 'post'); $select = &$form->addElement('select', 'bob'); $select->addOption('option1', '1'); $select->addOption('option2', '2'); $select->addElement('submit', null, 'Submit'); if ($form->validate) { print_r($form->getElementValue('bob'); } Outputs: Array ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23191&edit=1

« previous php.pear.dev (#15182) next »