|
Posted by Sherm Pendley on April 13, 2007, 6:42 pm
Please log in for more thread options
> I have done some searching through groups and haven't found an answer
> that suits my needs, so I hope to ask again. Is there a way to disable
> an anchor tag within HTML?
>
> Here's why:
> I am trying to write a persmissions based system where an
> administrator can log in and have a page customized to their rights. I
> could very easily remove links all together, but I want them to know
> that the system has that capability and they are just not allowed
> access. I've written code in JSP to handle and store the rights in a
> database and build the HTML page for display. However, I want to use
> something simple like:
>
> -A href="viewinfo.jsp"- View User Information -A-
> -A href="editinfo.jsp" disabled- Edit User Information -A-
>
> to just disable the ability to Edit information if they are not
> granted access.
>
> Does HTML have something that simple, or am I stuck using code and
> javascript to solve my problem???
JavaScript will absolutely *not* solve the problem. Trusting the client
to cooperate is not adequate security. It's not security at all.
You need to produce the "disabled" links on the server. If you want to
indicate to your users that they may be enabled under certain conditions,
produce links that point to a page or a JavaScript popup explaining why
the link isn't accessible to them.
In other words, since you can't disable links on the client, and since
it wouldn't be viable security to depend on clients obeying a hypothetical
"disabled" attribute even if such a thing existed, you'll have to "fake it"
by writing your server-side code to produce different targets for those
links.
> To simplify, why doesn't -A href- work like -Input type="checkbox"
> disabled-???
If you want to know why the W3C and/or browser makers chose not to allow
that, you'll have to ask them. Speculating about it here is pointless.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net Cocoa programming in Perl: http://camelbones.sourceforge.net
|