[snip]
i'm having a problem getting an UPDATE to work with radio buttons and
i'm not sure where it's gone wrong. the initial values are being grabbed
properly, but unfortunately they don't want to get updated. the regular
text form values update just fine. would appreciate some help.

the html:

<input type=hidden name="id" value="<?php echo $id ?>">

club member?<br>
No: <input type="radio" name="club_member" <?php if($row->club_member ==
'N'){echo 'CHECKED';}?>><br>
Yes: <input type="radio" name="club_member" <?php if($row->club_member
== 'Y'){echo 'CHECKED';}?>>
[/snip]

You have to create a value for the box...or check for ON

function radioBox($radioBoxState){
        /*
        ** this function will get the tail value of the checked radio
button
        ** and return the appropriate value for use by the database,
either a
        ** 'y' or 'n'
        */
        if(TRUE == preg_match('/Yes/', $radioBoxState)){
                $radioBoxState = "y";
        } elseif(TRUE == preg_match('/No/', $radioBoxState)){
                $radioBoxState = "n";
        }
        return $radioBoxState;
}
function checkBox($checkBoxState){
        /* 
        ** this is a function that will turn an 'on' checkbox into a 'y'
for the database
        ** if it is not 'on' an 'n' will be returned
        */
        if("on" == $checkBoxState){
                $checkBoxData = "y";
        } else {
                $checkBoxData = "n";
        }
        return $checkBoxData;

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to