Results 1 to 15 of 15

Thread: forcing text not to be a hyperlink hack

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    183

    forcing text not to be a hyperlink hack

    I have a page that is generating a hyperlink dynamically like so:


    <A HREF="http:www.google.com">Enter Site</A>

    but I want to put some tags around this so it doesn't appear, or function as a link and just displays the text as normal. Any ideas?

  2. #2
    Addicted Member
    Join Date
    Jul 2002
    Location
    Brussels, Belgium
    Posts
    139
    replace < by &lt;
    replace > by &gt;

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    is your host inserting this?

    or are you wanting to display html source to the viewer?

  4. #4
    Lively Member jamieoboth's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    116
    If you're going to be writing a lot of code like that, it may be wise to consider investing in a program like DreamWeaver. That allows you to just tpye normally on the page. Saves time, and effort


    James
    Ich widerstehe allem - nur nicht der Versuchung

    (I can resist anything but temptation)

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    I wouldn't advise getting an HTML editor. Makes you lazy and you forget the simple things like &gt; etc.

  6. #6
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    Originally posted by mendhak
    I wouldn't advise getting an HTML editor. Makes you lazy and you forget the simple things like &gt; etc.
    also messes up the "HTML Compliance".

    App's like MS Frontpage / Dreamweaver / PHP Edit and stuff like dat don't use the proper html formatting.
    Wayne

  7. #7
    Member
    Join Date
    Dec 2002
    Location
    Delaware
    Posts
    34
    Do:

    <xmp>

    <a href="link.html">this isn't real</a>
    <input type="text" name="text" value="neither is this">

    </xmp>
    Tolkien is the greatest writer ever.

  8. #8
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    That's not valid HTML though, and is likely to break on certain browsers. Depends whether you're worried about that. If you can't actually change the HTML source, I'd probably do something like innerHTML with JavaScript. Not the best solution, but the best I could think of.

  9. #9
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    Originally posted by Doe maar
    replace < by &lt;
    replace > by &gt;

    this isnt that hard to do though?
    Wayne

  10. #10
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I thought he meant he couldn't edit the code - it was embeded from a server-side call or something. Maybe not?

  11. #11
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    :wonder if he has it figured out any how, no new replies from the guy?
    Wayne

  12. #12
    Addicted Member
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    143

    USe this html editor

    It is very similar to notepad, just that it has high speed colour coding and autocomplete features and some other code generators.
    Unignal Software Team Developer
    -------------------------------------------
    Current Project:
    Noter Light
    -------------------------------------------
    http://www.unignal.sg.tf

  13. #13
    Addicted Member
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    143

    USe this html editor

    It is very similar to notepad, just that it has high speed colour coding and autocomplete features and some other code generators. the url is www.twk.2ya.com
    Unignal Software Team Developer
    -------------------------------------------
    Current Project:
    Noter Light
    -------------------------------------------
    http://www.unignal.sg.tf

  14. #14
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    Use onclick in a div tag surrounding regular text.

  15. #15
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    You may find that won't work though as the link will take over. Also I think it won't validate (if you're bothered about that) as I remember Punkpie haven't problems until he removed the onclick handler.

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