Issue 199 in php-form-builder-class: Default value for a radio button

13 views
Skip to first unread message

php-form-bu...@googlecode.com

unread,
May 16, 2013, 10:09:06 AM5/16/13
to php-form-builder...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 199 by garyburn...@gmail.com: Default value for a radio button
http://code.google.com/p/php-form-builder-class/issues/detail?id=199

How do you set a default value for for a group of radio buttons?

At present I add a group of radio buttons to a form object in the following
way:

$options = array('one'=>"Option #1", 'two'=>"Option #2", 'three'=>"Option
#3");
$form->addElement(new Element\Radio("Radio Buttons:", "RadioButtons",
$options))

I can't see anything in the documentation that demonstrates a default value.

I'm using version 3.1 and php 5.4

Thanks

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

php-form-bu...@googlecode.com

unread,
May 16, 2013, 10:13:27 AM5/16/13
to php-form-builder...@googlegroups.com

Comment #1 on issue 199 by ajport...@gmail.com: Default value for a
radio button
http://code.google.com/p/php-form-builder-class/issues/detail?id=199

Please try this...

$options = array('one'=>"Option #1", 'two'=>"Option #2", 'three'=>"Option
#3");
$form->addElement(new Element\Radio("Radio Buttons:", "RadioButtons",
$options, array("value" => "one")));

php-form-bu...@googlecode.com

unread,
May 16, 2013, 10:22:29 AM5/16/13
to php-form-builder...@googlegroups.com

Comment #2 on issue 199 by garyburn...@gmail.com: Default value for a radio
button
http://code.google.com/p/php-form-builder-class/issues/detail?id=199

That works.

Thank you.
Reply all
Reply to author
Forward
0 new messages