Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    215
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Dynamic link from cell

    Hello all. I have a table which displays the results of a recordset. What I want to do is to have the results hyperlink to a details page of that particular record. For some reason it's not working for me. Here is the code that I have so far:

    Code:
    <tr>
    <td style="cursor:hand;" onclick="A HREF='DummyPage.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ID=" & rsMods.Fields.Item("ID").Value %>'"><%=(rsMods.Fields.Item("FileName").Value)%></A></td>
    </tr>
    And when I view the source, I get the following (which seems ok to me):

    Code:
    <tr>
         <td style="cursor:hand;" onclick="A HREF='DummyPage.asp?ID=2'">Result 1</A></td>
    </tr>
                    
    <tr>
         <td style="cursor:hand;" onclick="A HREF='DummyPage.asp?ID=1'">Result 2</A></td>
    </tr>
    Any help would be greatly appreciated.

    Thanks in advance,

    Parallon

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what you want:
    PHP Code:
    <tr> <td style="cursor: pointer; cursor:hand;" onclick="location.href='test2.php'">Result 1</A></td> </tr
    slightly better:
    PHP Code:
    <script type="text/javascript"><!--
    function 
    redirect(url) {
        
    location.href url;
    }
    -->
    </script>
    <table>
    <tr> <td style="cursor: pointer; cursor:hand;" onclick="redirect('test2.php')">Result 1</A></td> </tr>
    <tr> <td style="cursor: pointer; cursor:hand;" onclick="redirect('test2.php')">Result 2</A></td> </tr>
    </table> 

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    215
    Thanks
    14
    Thanked 0 Times in 0 Posts
    That worked perfectly. Thank you so much!!!

    Parallon

  • #4
    Regular Coder
    Join Date
    May 2005
    Posts
    215
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Well, I thank you for the previous info, and now I was wondering if it is possible to either have it open a new window or a popup? Here is the code so far:

    PHP Code:
    <td onMouseOver="style.backgroundColor='#FFFF99';" onMouseOut="style.backgroundColor='#FFFFFF'" STYLE="cursor:hand;" onClick="location.href='test2.php'">Result 1</A></td
    At one time I had it opening a popup, but I wasn't sure on how to pass URL information to it.

    Thanks,

    Parallon


  •  

    Posting Permissions

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