php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23191 [QuickForm] Select box type problems
Submitted: 2003-04-13 20:50 UTC Modified: 2003-04-15 11:02 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jellybob@php.net Assigned:
Status: No Feedback Package: PEAR related
PHP Version: 4.3.1 OS: Debian 3.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
26 + 10 = ?
Subscribe to this entry?

 
 [2003-04-13 20:50 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-14 02:16 UTC] 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-15 11:02 UTC] mansion@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC