• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

how to make a link readonly?

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How can i make a link readonly or disabled in html depending on certain conditions(The wordings of the link should be visible,but the link should be deactivated).
[ April 10, 2007: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the simple way to do this.



use onclick event instead of "onklick"
 
Christian Nash
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to make this link disabled in the same way we would make a radio button or a text field etc..
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if there is another way to disable the link.
The only way i know is to disable the link, you need to add an onclick and return false.
 
Ranch Hand
Posts: 249
Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may not be the most efficient way of doing it, but put your link inside a <div> tag, and then create a function to change the innerHTML of that tag.

 
Marshal
Posts: 67357
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can short-circuit the event in a number of way (Saif showed you one) and can use CSS to make it appear "grayed out", if that's what you mean.
 
The first person to drink cow's milk. That started off as a dare from this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!