• 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 disable a link

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I need to enable or disable a link <a href="link.html">click here</a> depending on a intial intial condition yes or no. Can anyone suggest me how to do this.
Thanks
sruthi
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't really disable a link. Not like you can an input element. The general pattern is if you can't click it you shouldn't see it. If that is not an option you can remove the href attribute or replace the link with a block element like a span or div.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gregg's idea is best, but here is another way: http://radio.javaranch.com/pascarello/2005/05/17/1116355421179.html

Eric
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eric Pascarello:
Gregg's idea is best, but here is another way: http://radio.javaranch.com/pascarello/2005/05/17/1116355421179.html

Eric



Note that disabling JavaScript will make Eric's solution fail. If you can control that (intranet site vs internet site) then his solution would work great.
[ October 27, 2008: Message edited by: Gregg Bolinger ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic