I have a view that has a navigation button to another view that looks like this:
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:
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?
Thanks
<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$('#GoIssue').addClass("disabled");// 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')); });Am I missing something? Is there a simpler way?
Thanks