| Author |
how to make a link readonly?
|
Christian Nash
Ranch Hand
Joined: Jan 17, 2006
Posts: 107
|
|
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 ]
|
- Christian
|
 |
Muhammad Saifuddin
Ranch Hand
Joined: Dec 06, 2005
Posts: 1318
|
|
This is the simple way to do this. use onclick event instead of "onklick"
|
Saifuddin..
[Linkedin] How To Ask Questions On JavaRanch My OpenSource
|
 |
Christian Nash
Ranch Hand
Joined: Jan 17, 2006
Posts: 107
|
|
|
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
Joined: Dec 06, 2005
Posts: 1318
|
|
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
Joined: Oct 21, 2003
Posts: 246
|
|
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.
|
Mike Firkser
Rutgers '84
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: how to make a link readonly?
|
|
|