Reputation: 1
I am developing a web form using jsf. In that i need to disable the while the form gets loading,then again it wil enable after completing the form loading
Upvotes: 0
Views: 5024
Reputation: 597106
That can be done only on the client side, with javascript:
disabled="true"
Upvotes: 1
Reputation: 1108742
Put a <script>
right after the button which disables it.
<h:form id="myform">
<h:commandButton id="mybutton" />
<script>document.getElementById('myform:mybutton').disabled = true;</script>
On window.onload
, enable it again. It doesn't matter where this script is placed.
<script>window.onload = function() { document.getElementById('myform:mybutton').disabled = false; }</script>
Upvotes: 3