SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    auto select radio button from database value

    hi guys i really need your help! this is about radio button and database. i have radio button html ..
    <tr class="tr_a">
    <td align="center">1</td>
    <td>&nbsp;Formulir Pendafataran</td>
    <td align="center"><input type="radio" name="dat[satu]" id="radio" value="Ada" /></td>
    <td align="center"><input name="dat[satu]" type="radio" id="radio2" value="Tidak" /></td>
    </tr>
    <tr class="tr_b">
    <td align="center">2</td>
    <td>&nbsp;Formulir Keikutsertaan</td>
    <td align="center"><input type="radio" name="dat[dua]" id="radio" value="Ada"/></td>
    <td align="center"><input name="dat[dua]" type="radio" id="radio2" value="Tidak"/></td>
    </tr>
    i processed it to database and i save all the value in "field", ex. "Ada,Ada".
    the problem is when i want to edit the page, i want my all my radio button selected based on database value or the field, what should i do from guys? please help!?

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Retreive the data from the database, and then add
    Code:
    selected="selected"
    to the selected option.

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can u explain me clearer step?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •