Fix for Fix for Submit and hide a form

  1. $(document).ready(function(){
  2.  
  3.   //removes submit button - assumed the class of the button is "form-submit"
  4.   $('.form-submit').remove();
  5.  
  6.   //adds a new submit button to the form with the class "my-form"
  7.   $(".my-form").append('<input type="submit" value="Submit" class="jquery-submit">');
  8.  
  9.   //when submit button is clicked, submit all forms
  10.   $('.jquery-submit').click(function(){
  11.     $('.my-form').submit();
  12.     $('.my-form').slideUp('medium', function() {
  13.         // Animation complete. Say thanks!
  14.         $(".my-form-container").append('<div class="thanks" style="opacity: 0;"><p>Thanks for submitting!</p></div>');
  15.         $('.thanks').fadeTo(500, 1);
  16.       });
  17.   }
  18. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.