0

how can I disable a commandbutton (ajaxbutton) when the user clicks on it?

i tried it with:

onclick="javascript:this.disabled='true';"

and

onclick="document.getElementById('buttonid').disabled='true'"

but nothing works?

1
  • Can you show some HTML too? You don't need to prefix your script with javascript: inside an onclick handler. Commented Jul 31, 2013 at 6:50

1 Answer 1

1

For your specific problem I think you just need to remove the quotes around 'true'. But also look at this link How can I disable an h:commandButton without preventing the action and actionListener from being called?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.