I want 5 min after the page is loaded. Activate a button that is disabled.

UI Components for JSF
Post Reply
seifi
Posts: 5
Joined: 21 Jul 2022, 07:54

10 Aug 2022, 07:10

I use PrimeFaces 7.0

I tried to make a function with jquery but it doesn't work.

jQuery(document).ready(function() {
jQuery(document).ready(function() {
if (document.getElementById("resultsFormId:neueTanAnfordern") != null) {
setTimeout(function() {
document.getElementById('resultsFormId:neueTanAnfordern').disabled = false;
document.getElementById('resultsFormId:neueTanAnfordern').removeAttribute("aria-disabled");
document.getElementById('resultsFormId:neueTanAnfordern').removeAttribute("disabled");
}, 15000);
}
});
});

before function execution :
<div class="ui-g-6 ui-md-3 ui-lg-3">
<button id="resultsFormId:neueTanAnfordern" name="resultsFormId:neueTanAnfordern" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left ui-state-disabled"
onclick="PrimeFaces.ab({s:&quot;resultsFormId:neueTanAnfordern&quot;,f:&quot;resultsFormId&quot;,u:&quot;resultsFormId&quot;});return false;" type="submit" disabled="disabled" role="button" aria-disabled="true">
<span class="ui-button-icon-left ui-icon ui-c ui-icon-phone-android"></span><span class="ui-button-text ui-c">Neue TAN anfordern</span></button>

</div>

After function execution :
<div class="ui-g-6 ui-md-3 ui-lg-3">
<button id="resultsFormId:neueTanAnfordern" name="resultsFormId:neueTanAnfordern" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left ui-state-disabled"
onclick="PrimeFaces.ab({s:&quot;resultsFormId:neueTanAnfordern&quot;,f:&quot;resultsFormId&quot;,u:&quot;resultsFormId&quot;});return false;" type="submit" role="button">
<span class="ui-button-icon-left ui-icon ui-c ui-icon-phone-android"></span><span class="ui-button-text ui-c">Neue TAN anfordern</span>
</button>
</div>


aria-disabled="true" is not im Button tag , but Button stay disabled

I thank you in advance

jepsar
Posts: 166
Joined: 03 Sep 2014, 11:41
Location: NL / BE
Contact:

10 Aug 2022, 17:19

PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub: https://github.com/jepsar
Spotify: 90s Rave, Acid, Trance, House

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests