Guest User

Untitled

a guest
Aug 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. How to disable a <g:submitToRemote/> button
  2. <!-- Whatever you have before your g:submitToRemote button-->
  3. <g:checkBox name="myCheckBox" />
  4. <g:submitToRemote name="myButton" />
  5. <!-- Whatever you have after your g:submitToRemote button-->
  6.  
  7. <!-- Some jQuery to disable the button at the end of your document-->
  8. <g:javascript>
  9. $(document).ready(function() {
  10. $("#myCheckBox").change(function{
  11. // myButton is disabled if myCheckBox is checked
  12. if($("#myCheckBox").prop("checked")){
  13. $("#myButton").attr("disabled", "disabled");
  14. }
  15. else{
  16. $("#myButton").removeAttr("disabled");
  17. }
  18. });
  19. });
  20. </g:javascript>
  21. </body>
  22. </html>
Add Comment
Please, Sign In to add comment