Re: radiobutton
| From: | James, Yz | Date: | Thu, 08 Feb 2001 21:42:49 +0000 |
| Subject: | Re: radiobutton | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-38816@lists.php.net to get a copy of this message | ||
If someone's updating a form, and I want their last settings to appear in a
the correct radio button, I use this:
<input type"Radio" name="I_like" <? if ($I_like == "PHP") { echo
"CHECKED" }
?>>
<input type"Radio" name="I_like" <? if ($I_like == "ASP") { echo
"CHECKED" }
?>>
So, on a form with a Radio button asking which you prefer, the one that
they've voted for before is the default button to be checked.
Oh, and I know that's probably messy :)
If you want to get the results, you'd print
The user liked <? echo "$I_like"; ?>!
James.
Hello,
I have sometging like this:
<input type="Radio" name="radio1" value=<? echo $opt1 ?>">Opt1
how I know if some user choose some radiobutton???
I tried if($opt1) , but without success....
T.Y.
Miguel Loureiro <m.loureiro@distrim2.pt >