Lets say you have the following inputs:
<INPUT TYPE='Checkbox' NAME='MrCheckBox' VALUE='ImaChecked!'>
<INPUT TYPE='Radio' NAME='ColorPreference' VALUE='Green'>
<INPUT TYPE='Radio' NAME='ColorPreference' VALUE='Brown'>
And you wanted MrCheckBox to be marked, and the ColorPreference to be Brown.
You would have PHP output this:
<INPUT TYPE='Checkbox' NAME='MrCheckBox' VALUE='ImaChecked!' CHECKED>
<INPUT TYPE='Radio' NAME='ColorPreference' VALUE='Green'>
<INPUT TYPE='Radio' NAME='ColorPreference' VALUE='Brown' CHECKED>
I normally do this:
1. Retrieve Info from DB
2. If ( ColorPreference = Green )
{
$GreenChecked = "CHECKED";
}
elseif ( ColorPreference = Brown )
{
$BrownChecked = "CHECKED";
}
<INPUT TYPE='Radio' NAME='ColorPreference' VALUE='Green' $GreenChecked>
<INPUT TYPE='Radio' NAME='ColorPreference' VALUE='Brown' $BrownChecked>
This way, one of those variables will contain the word CHECKED, which will
in turn, mark the desired radio button.
- jonathan
"Hector M Banda" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
> How can I keep the values of objects like radio buttons on a PHP page
> when the page is refreshed?
>
> What I mean is that I 'm using the same form to interact with the user
> and to display the information based on the output of a particular
> query.
>
>
> Thanks,
>
> --
>
>
> -hb
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]