How to disable a main link

Hello sir’s,

Can anyone tell me how can i disable the main link on my navigation.
i have manage to use onclick=javascript:return false; on the sub link but on the main link i’am lost…
Can any one suggest how can i manage this one.
Thanks very much.

this is my code for my navigation


<ul class='menu' id='menu' name='menu'>
<li><a href='createticket.php'  target='body'>Create Ticket</a></li>
//main link with sublink
<li><a href='#' onclick="javascript:return false;">User Maintenance</a><ul><li ><a href='Users.php' target='body'>View User</a></li><li><a href='Viewuser.php' target='body'>Edit User</a></li><li><a href='passchange.php' target='body'>Reset Password</a></li></ul>
</li>
<li><a href='Dept.php' target='body'>Department</a></li>
<li ><a href='Cat.php' target='body'>Category</a></li>
<li><a href='subcat.php' target='body'>Sub-Category</a></li>
//main link with sublink
<li><a href='#'>Ticket Options</a><ul><li><a href='AssignTicket.php' target='body'>Assigned Ticket</a></li><li><a href='UnAssignticket.php' target='body'>Pending Ticket</a></li><li><a href='ClosedTicket.php' target='body'>Closed Ticket</a></li></ul></li>
<li><a href='tickethistory.php' target='body'>Ticket History</a></li><br/><li><a  href='logout.php' target='_parent'>LOG OUT</a></li>
</ul>

No really sure what you mean here?

If you don’t supply an onlick=“…” nothing will happen. If you’re wanting to call a function that will itself decide whether it should do something or not, based on some other application state, then you would write a function, and put onclick=“myfunction();” instead. The code in the fuction ‘myfunction’ would then need to be able to apply the logic to do something, or not.

If that is not what you mean, please explain…

Thanks for the reply…i put the onclick=“javascript:return false;” but is there a way that on the main link <a href=‘#’ onclick=“javascript:return false;”>User Maintenance</a> that the below sub-link will not navigate. or i must put the said js code on every link to disable the link.


<li><a href='#' onclick="javascript:return false;">User Maintenance</a>
<ul><li ><a href='Users.php' target='body'>View User</a></li>
<li><a href='Viewuser.php' target='body'>Edit User</a></li><
<li><a href='passchange.php' target='body'>Reset Password</a></li>
</ul>
</li>