onClick=return false

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
bomz
Beginner
Beginner
Posts: 8
Joined: Mon Sep 29, 2003 1:24 pm

onClick=return false

Post by bomz »

Is it me or clickfunction does not work as onClick? What I'm trying to do is something like this (just idea, implementation is more complex):

<a href="http://www.nba.com" onClick="return false;">

This link should be disabled. How to do it with 5v menu? aI("url=http://www.nba.com;clickfunction=return false;") won't work. Please advise.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi,

The clickfunction property is separate from the url property. Your clickfunction will still fire, but if the menu item also has a defined url, as in your example, then the browser will load that url.

If you want to disable a menu item that already has a url defined, the most direct route it to it's type property to disabled, like so:

Code: Select all

aI("url=http://www.nba.com;type=disabled;");
This could be done effectively by (1) generating the menu dynamically from a database, or (2) changing the menu item property dynamically with javascript.

Hope that helps,

Kevin
bomz
Beginner
Beginner
Posts: 8
Joined: Mon Sep 29, 2003 1:24 pm

Post by bomz »

got it. Thanks
Post Reply