Guest User

Untitled

a guest
May 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. // Snippet to change GravityForms 'Submit' button to 'Processing...' and disable it
  2. add_filter('gform_pre_render_1', 'disable_submit');
  3. function disable_submit($form) {
  4. ?>
  5.  
  6. <script type="text/javascript">
  7. jQuery(document).ready(function($){
  8. $('#gform_submit_button_<?php echo $form['id']; ?>').on('click', function(event){
  9.  
  10. var submitCopy = $(this).clone();
  11. submitCopy.prop('id', '').prop('disabled', true).prop('value', 'Processing, please wait...').insertAfter($(this));
  12.  
  13. $(this).hide();
  14.  
  15. });
  16. });
  17. </script>
  18.  
  19. <?php
  20. return $form;
  21. }
Add Comment
Please, Sign In to add comment