"How do you disable a button on a page after one click?"I figured since I was going to answer the question anyway, I would publish a quick example of one way to do it.
1 2 3 4 5 6 7 | <script type= "text/javascript" > function once() { alert( 'Hello' ); document.getElementById( 'form4:button1' ).onclick = null ; document.getElementById( 'form4:button1' ).value = 'All Done' ; } </script> |
1 2 3 | <h:form id= "form4" > <h:button id= "button1" onclick= "once();return false;" value= "Run Once!" /> </h:form> |
0 comments :
Post a Comment