Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make a link readonly?

 
Christian Nash
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 ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
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: 1324
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.
 
Mike Firkser
Ranch Hand
Posts: 249
Java Oracle PHP
  • 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.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64973
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic