• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to disbale a link in firefox

 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to disable a href link by doing:

<a href= "#" disabled="disabled" >...</a>

But it doesn't work in Firefox.
In IE, the link is in grey and disabled though.

Can someone tell me how to make it work in Firefox? Thanks.
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You sure it works on IE? I tried the same but it doesn't work for me. Sure the link appears gray but when I click on this I see the href url loaded. What IE version you are on? W3C doesn't state about disabling the link. The property applied just to form control.

This is how I would do to disable the link (to make it gray you need to use style's)
< a href="..." onkclick="return false;"/>
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
disabled="disabled" -> disabled="true", but I think this is IE only.
As Purushothaman said, returning false on onclick should do the trick.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you search the forum, you will see this topic has been talked about a lot in the past.

Eric
reply
    Bookmark Topic Watch Topic
  • New Topic