Advanced Search

Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Show variable as a link in form output?

  1. #11
    Join Date
    Mar 2011
    Location
    N 11° 19' 0.0012 E 142° 15' 0
    Posts
    1,419
    Thanks
    37
    Thanked 84 Times in 83 Posts
    Blog Entries
    3

    Default

    Code:
    var past="<a href = "reunion-1965.php"> <b>Class of 1965 - There is no reunion information available.</b></a>"
    This code will never work because of the "" in the href tag... it thinks it's ending the variable past even though it shouldn't be...

    Try this instead

    Code:
    var past="<a href = 'reunion-1965.php'> <b>Class of 1965 - There is no reunion information available.</b></a>"
    ead
    keebs - keyboard1333 [at] gmail [dot] com
    Anime Views Forums

  2. #12
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,020
    Thanks
    47
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    or you could escape them:
    Code:
    var past="<a href = \"reunion-1965.php\"> <b>Class of 1965 - There is no reunion information available.</b></a>"
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  3. #13
    Join Date
    Jul 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Still not working...

    Thanks for the extra eyes. I agree that the extra "'s would kill off the VAR statement.
    I did change it and use the' instead but with the same results. It just shows the whole variable in the output.
    You can see what it is looking like at:
    http://kohs.us/1965.htm

    The whole point of trying to get this to show as a link as I wanted to use this as an include in other pages and the link would take you to the page with information.

  4. #14
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,020
    Thanks
    47
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    here's a novel idea, you could set up an a tag in the code and then output the correect text and change the href depending on what day it is.
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

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
  •