Radio Button

radio_button

Syntax:

$form_helper->radio_button( $object_name, [ $column_name ], $tag_value, [ $options ])

Description:
The radio buttons in a group will all have the same $object_name and $column_name. $tag_value will be different for each button. The button whose $column_name is equal to the $tag_value will be checked. Additional options are to be passed as an $options array. Example:

$form_helper->radio_button("post", "category", "PHP"); 
$form_helper->radio_button("post", "category", "Ruby");

if the default $Post->category() is “PHP”, the code generated is

<input type="radio" id="post_category" name="post[category]" value="PHP" checked="checked" /> 
<input type="radio" id="post_category" name="post[category]" value="Ruby" />

radio_button_tag

Syntax:

$form_tag_helper->radio_button_tag( $name, $value, [ $checked ], [ $options ])

Description:
The radio buttons in a group will all have the same $name. $value will be different for each button. $checked defaults to false.
Additional options are to be passed as an $options array.

 
helper-radio.txt · Last modified: 2008/03/06 22:41 by alake