PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Bug #3653

setValue not working

Details

Submitted2005-03-01 03:37 UTC
Fromdcrookston at gmail dot com
StatusBogus
Packagehtml_quickform
PHP Version4.3.10
OSLinux-something
Roadmaps(Not assigned)

Comments

[2005-03-01 03:37 UTC] dcrookston at gmail dot com

Description:
------------
When I execute the code in the "reproduce code" part, the value for $box is still set to 1, not to whatever $checked_value is.

Reproduce code:
---------------
$box = $form->createElement('checkbox', $name, $display);
$box->setValue($checked_value);
$form->addElement($box);

Expected result:
----------------
What I expect is that the value="" part of the checkbox will be set to something meaningful, i.e. the value of $checked_value.

Actual result:
--------------
The value="" part stays set to "1"

[2005-03-01 22:12 UTC] bmansion at mamasam dot com

This is the expected behavior. A checkbox value in QF is always 1 when checked. If you need a different value (something I personally doubt), have a look at the advcheckbox element.