Disabling anchor tag button

2 posts, 0 answers
  1. Russ
    Russ avatar
    10 posts
    Member since:
    May 2012

    Posted 21 Oct 2013 Link to this post

    I have a view that has a navigation button to another view that looks like this:
    <a id="GoIssue" data-role="button" href="Main/Issue?priorPage=Picklist&fieldName=reqOrWO&value={TBS}" data-icon="details" ></a><br>

    I'd like to disable it under certain conditions.   I have tried adding a class to it and checking the class in the click handler:
    //  Start disabled until someone puts something IN the reqOrWO field
    //  disabled is implemented by returning false on the click action if it has the disabled class
    //  the disabled class also has visual aspects as well.
    $('#GoIssue').click(function ()
            event.preventDefault ? event.preventDefault() : event.returnValue = false;
            return (!$(this).hasClass('disabled'));
    At first, I just tried returning false, but navigation still occurred.  So, I tried adding the additional code to call preventDefault() [if present] and event.returnValue [if not].  But none of this seems to prevent the navigation from going to the target page.

    Am I missing something?  Is there a simpler way?


  2. Kiril Nikolov
    Kiril Nikolov avatar
    2596 posts

    Posted 23 Oct 2013 Link to this post

    Hello Russell,

    Unfortunately enable/disable functionality of the Kendo UI Mobile Button is not supported at the moment. But please take a look at the following blog post, discussing a similar problem and a possible resolution:


    If you want to prevent the clicking of the button, you can use the data-click attribute and handle the event parameter there (e.preventDefault).
    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top