Reputation: 721
So I thought it would be simple enough to disable the button on the web-page with this attribute, but it is not working as expected since the button is still fully clickable.
The end goal is a "greyed out" button that is not clickable based on conditions, but even just trying to disable the button all the time does not appear to work. Any help would be appreciated.
Code for button
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %>
<div id="viewLogButton" class="type-button" align="center" >
<s:url var="getLog" action="getRPLog" />
<sj:a button="true" disabled="true" formIds="getRPLog" onClickTopics="getRPLogSubmit" href="%{getLog}">View Log</sj:a>
</div>
Upvotes: 0
Views: 433
Reputation: 3006
There is no disabled attribute for hyperlinks. Add class 'disabled' and apply the css pointer-events: none; for that. maybe it will help.
like.
<style>
a.disabled {
pointer-events: none;
cursor: default;
}
</style>
Add the 'disabled' class based on condition.
<!-- add class="disabled" based on your condition -->
<sj:a button="true" class="disabled" formIds="getRPLog" onClickTopics="getRPLogSubmit" href="%{getLog}">View Log</sj:a>
Upvotes: 1