SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    May 2005
    Posts
    209
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb A Teaser For U Guys

    friends,
    kindly see the code below and tell me if something is wrong in it, since it isn,t working.
    what i want is that the radio button corresponding to value "soon" should get clicked( that is ticked) if the flag 'post_after_approval' is set in the db. the datatype of 'post_after_approval' is tinyint.
    The radio button corresponding to value "specific" is the radio button which gets ticked by default if the flag field in th edatabase is not set.
    when i open the page in the browser, the radio button corresponding to the value "soon" never gets checked even if the flag in the db is set to1.
    PHP Code:
    <td width="6%"><input type="radio" name="default1" value="soon" border="0" <? if($row1['post_after_approval']==1):?>CHECKED<?endif;?> onclick="reset_cal();"></td>
                            <td width="26%">As soon as it is approved.</td>
                            <td width="6%"><input type="radio" name="default1" value="specific" border="0" checked>
                            </td>
                            <td width="52%"><table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td width="20" >Specific Date:</td>
    kindly help.kindly suggest an alternate way that i can achieve the same if at all u r not able to detect the fault in the above.
    Last edited by navajes123; Sep 24, 2005 at 05:57.

  2. #2
    SitePoint Addict jkassemi's Avatar
    Join Date
    Jan 2005
    Location
    Albuquerque
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not familiar with the endif style ifs... But try this:

    PHP Code:
    <td width="6%"><input type="radio" name="default1" value="soon" border="0"

    <?php if($row1['post_after_approval']==1){ echo "CHECKED"; } ?> 

    onclick="reset_cal();"></td> <td width="26%">As soon as it is approved.</td>
                            <td width="6%"><input type="radio" name="default1" value="specific" border="0" checked>
                            </td>


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
  •