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
    wac
    wac is offline
    Regular Coder wac's Avatar
    Join Date
    Sep 2002
    Location
    Cary, North Carolina, USA
    Posts
    359
    Thanks
    2
    Thanked 0 Times in 0 Posts

    disable dragging link to address field

    Is there a way in IE and FF to disable the ability to drag links (and apparently any selected text in FF) to the address bar? I'm not in a position to change how the links are created but I could possibly modify some HTML or javascript property if such were available...
    Wayne Christian

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    You could do something like this:

    <a href="#" onclick="location.replace(NEW LOCATION)">Link</a>

    Then when you dragged the link into the address bar, it would point at '#'

    NOTE: NOT RECOMMENDED!!!!!

    This is horrible for accessibility, since a user with JS disabled will not be able to use the link

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    wac
    wac is offline
    Regular Coder wac's Avatar
    Join Date
    Sep 2002
    Location
    Cary, North Carolina, USA
    Posts
    359
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Unfortunately, I don't have access to the code which generates the link, which already has javascript attached to the link. Although, I suppose I could do this in javascript by attaching an additional function to (all?) the link onclick.
    I was hoping for some magic metadata tag in the header. I'll brood on this for a while...
    Wayne Christian

  • #4
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Quote Originally Posted by wac
    I was hoping for some magic metadata tag in the header.
    The only way to do what you want is to mask the real link location from the browser. The feature that enables the user to drag the link to the address bar is from the browser, not the code.

    That said, it is probably not a good idea to mess with the client's interface.

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

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