views:

11

answers:

1

Hi, I am trying to implement a radio button input helper for my PODSCMS for a boolean field. The requirement is straight forward. Instead of displaying a checkbox, I want to display two radio buttons with 'Yes' and 'No' option and based on what is selected I want to either insert 1 or 0 in the db column. Here is the code I have so far for my input helper It works fine when it reads an already existing value from the db. However, when I try to add a new value it always fails and adds 0 even though I select 'Yes' from the radio button.

<input id="<?php echo $css_id; ?>" class="form pick1 <?php echo $name; ?> pods_field pods_field_<?php echo $name; ?> pods_coltype_bool" type="radio" name="grp1" value="1"

<?php
if($value == 1) {
echo "checked";
}
?>

>Yes</input>
<input id="<?php echo $css_id; ?>" class="form pick1 <?php echo $name; ?> pods_field pods_field_<?php echo $name; ?> pods_coltype_bool" type="radio" name="grp1" value="0"

<?php
if($value == 0) {
echo "checked";
}
?>
>No</input>
A: 

We're building in Radio / Checkboxes into the next release of Pods UI which will contain the new Form API / UI. Should be out late September.

Scott Kingsley Clark