Re: How to keep selection on radio buttons when the form is refreshed?
| From: | Joel Gilbert | Date: | Thu, 26 Apr 2001 01:38:57 +0000 |
| Subject: | Re: How to keep selection on radio buttons when the form is refreshed? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8897@lists.php.net to get a copy of this message | ||
Hi,
If you want to keep the selection, use the value of the form radio
buttons to determine whether the button is selected or not. One way to do it
is:
<?php
echo "Radio1<INPUT TYPE=RADIO NAME=radio1 VALUE=value";
if( isset($radio3) )
{
if( $radio1 == 'value' )
echo " CHECKED";
}
echo "><BR>";
?>
This will check if the radio button has been selected, and if so it adds the
"CHECKED" keyword to the radio tag.
You can do similar things with other form inputs, such as text, textfield,
dropdown menus, etc.
"Hector M Banda" <hector@need-info.com> wrote in message
news:5.1.0.14.0.20010425155259.00a03050@24.1.187.154...
> Hi all,
> I have some radio buttons like: department, vendor, etc, on my form but at
> the time I submit or refresh the form, my radio buttons do not keep the
> selection.
>
> I have not idea in how to do tell PHP to keep the values of the objects
> when the form is refresed.
>
> Thanks,
>
>
>
>
> -hector
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>