SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    Code:
    <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>

  2. #2
    SitePoint Member
    Join Date
    Sep 2011
    Location
    Birsbane, Australia
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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....

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Code:
    <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>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •