SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: fix if statment

  1. #1
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    vi
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation fix if statment

    I am tryinto say id RelatedURL has something then use it, if not then use the other.
    It only give me the other link.

    [CODE]
    <%
    if inStr(ListFields,"RelatedURL")>0 AND RelatedURL<>"" then
    %>

    <A href='<% =objRS("RelatedURL") %>' class='ContentLinkFont' target='ext'><img src='<% =objRS("thumbnail") %>' class='thumbnail'></A></A>
    <% else %>

    <A href='content.do?contentid=<% =objRS("contentid")%>'>
    <img src='<% =objRS("thumbnail") %>' class='thumbnail'> </A>

    </div>
    <div Style="width:100%; padding-left: 5px; padding-right: 2px;">
    <% =objRS("ShortDesc") %>

    </div>
    <% end if%>

  2. #2
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you're checking the value pulled from a query, then you should have the objrs in front...
    [CODE]
    <&#37;
    if inStr(ListFields,objRS("RelatedURL"))>0 AND objRS("RelatedURL")<>"" then
    %>

    <A href='<% =objRS("RelatedURL") %>' class='ContentLinkFont' target='ext'><img src='<% =objRS("thumbnail") %>' class='thumbnail'></A></A>
    <% else %>

    <A href='content.do?contentid=<% =objRS("contentid")%>'>
    <img src='<% =objRS("thumbnail") %>' class='thumbnail'> </A>

    </div>
    <div Style="width:100%; padding-left: 5px; padding-right: 2px;">
    <% =objRS("ShortDesc") %>

    </div>
    <% end if%>

  3. #3
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    vi
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if objRS("RelatedURL")<>"" then

    Is the correct answer, i figured it out. Thanks.


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
  •