Posted by 铁托 on 04/11/07 09:02
On Apr 10, 3:47 am, "frits" <fsc...@hotmail.com> wrote:
> I have the following code:
>
> <input type="radio" id="q1" name="q1" value="Yes">
> <input type="radio" id="q1" name="q1" value="No">
>
> Now I want to check if the button q1 is used so the code must be extended.
> When the button is not used, the value must be "q1 not used".
>
> How can I do that? I will not use the "checked" option in the code if it is
> showed in the site.
> When there is a hidden "checked" option than the value of q1 is always "q1
> not used" what can be a solution....
>
> Frits
<?
$q1 = $_REQUEST['q1'];
?>
<input type="radio" id="q1" name="q1" value="Yes"
<?php if($q1 == 'yse')
{
echo ' checked="checked" ';
}
?>
>
<input type="radio" id="q1" name="q1" value="No"
<?php if($q1 == 'no')
{
echo ' checked="checked" ';
}
?>
>
[Back to original message]
|