[FX.php List] Displaying existing data in Form for radio/checkboxes (Resend)

Gjermund Gusland Thorsen ggt667 at gmail.com
Mon Sep 26 02:57:43 MDT 2005


"/>" is xhtml tag termination symbol, for tags without closing tag.

<br/>

br does not have ending tag, but td has ending tag

<td>

</td>

On 9/24/05, Jonathan Schwartz <jonathan at eschwartz.com> wrote:
> Perfect!
>
> Mine was ugly because I had reversed the if logic, creating a
> separate set of the three inputs for each value choice.
>
> In your method, there are essentially three single radio buttons,
> each with its own id statement.
>
> Much neater.
>
> Thanks
>
> Jonathan
>
> BTW....What is the "/" for, before the end of input ">"?
>
>
>
>
>
> >Hey Jonathan,
> >
> >You were on the right track with if statements, but they shouldn't get too
> >ugly, especially if you're only dealing with single possibilities like radio
> >buttons..
> >
> >Here's an example, which assumes that the field which can contain the Yes,
> >No, or Maybe values is called 'eatDonuts'.
> >
> >Do you eat donuts?
> ><input name="eatDonuts" type="radio" id="eatDonuts" value="Yes" <?php
> >if($dbData['data'][$dbKey]['eatDonuts'][0] == 'Yes') echo "checked";?>/> Yes
> ><input name="eatDonuts" type="radio" id="eatDonuts" value="No" <?php
> >if($dbData['data'][$dbKey]['eatDonuts'][0] == 'No') echo "checked";?>/> No
> ><input name="eatDonuts" type="radio" id="eatDonuts" value="Maybe" <?php
> >if($dbData['data'][$dbKey]['eatDonuts'][0] == 'Maybe') echo "checked";?>/>
> >Maybe
> >
> >Hope this helps...
> >
> >Cheers
> >Steve
> >
>
> --
>
> Jonathan Schwartz
> Schwartz & Company
> 817 Marin Drive
> Mill Valley, CA 94941
> Phone: 415-381-1852
> jonathan at eschwartz.com - http://www.eschwartz.com
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>


More information about the FX.php_List mailing list