[liphp] problem populating radio button fields

Tim Sailer [email protected]
Mon, 23 Jun 2003 13:30:24 -0400


On Mon, Jun 23, 2003 at 01:07:28PM -0400, Venkatagiriyappa, Veena wrote:
> Hi,
> I have few fields which are of type "radio button" in my html form. I need
> to populate those with the values from database. But, with the below code
> it;s not doing correctly. 
> 
> [code]
> <td>Experiment type:</td>
>         <td>
>                 <input type="radio" name="expt" value="MAD"
> <?if($proposal_data[7]=="MAD")?>checked="checked">MAD
>                 <input type="radio" name="expt"
> value="SAD"<?if($proposal_data[7]=="SAD")?>checked="checked">SAD
>                 <input type="radio" name="expt" value="Single Wavelength"
> <?if($proposal_data[7]=="Single Wavelength")?>checked="checked">Single
> Wavelength </td>
> [/code]
> 

Jeez... I'm going back on faulty memory with my raw html, but don't
you mean to do something like:

<input type="radio" name="expt" value="MAD" <?if($proposal_data[7]=="MAD") {echo "checked";} ?> >MAD

Tim

-- 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>> Tim Sailer                       ><  Coastal Internet, Inc.          <<
>> Network and Systems Operations   ><  PO Box 726                      <<
>> http://www.buoy.com              ><  Mastic, NY 11955                <<
>> [email protected]                     ><<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<