CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    10

    Dynamically create links using the data from a tables cell as a parameter

    I’m trying to using javascript to create a onclick even that will find the value in the 2nd cell of the row that has been clicked on and then create a URL link using this value per row.

    Example

    ID FirstName SecondName
    1 Mike Jones
    2 Jane Downs

    URL to create :
    http://www.aURL.cn?Val=Mike
    OR
    http://www.1URL.cn?Val=Jane

    I am currently wrapping the rows with a href with a onclick even in the tag : onclick="this.href = makeLinks()”but I am not getting anywhere with it yet ,
    [EDIT]
    Sorry to clear up makeLinks is a function but I have not started to program in it yet as I have no idea how to reference the cells and columns, I guess it is something to do with htmltableelement or a node or something I’m not 100% up to scratch with javascript yet ><
    [/EDIT]
    Any ideas?

    Regards
    cyph
    Last edited by cypher_soundz; April 27th, 2006 at 08:11 AM.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Dynamically create links using the data from a tables cell as a parameter

    You need HTML DOM for this. W3Schools has all you need for this. Take a look at this. If that does not work, browse through the DOM section.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Mar 2006
    Posts
    10

    Re: Dynamically create links using the data from a tables cell as a parameter

    Hi,

    Thanks alot for the link i will look in to it.

    Regards
    cyph

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Dynamically create links using the data from a tables cell as a parameter

    You're welcome.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured