Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Ajax loading doesnt work when form validates
  2. $(document).ready(function(){
  3.     $("#uploadform").submit(function(e){
  4.         var valid_form = validateForm();
  5.  
  6.         if (valid_form){
  7.             $("#pb").load("/php/progressbar.php");
  8.         }
  9.         return valid_form;
  10.     });
  11. });
  12.        
  13. if (valid_form){
  14.     $("#pb").load("/php/progressbar.php", function(){
  15.         $("#uploadform").unbind('submit').submit(); // unbind so you are not recursive
  16.     });
  17. }
  18. return false;
  19.        
  20. if (valid_form){
  21.     $("#pb").load("/php/progressbar.php", function(){
  22.         $("#uploadform").unbind('submit').submit(); // unbind so you are not recursive
  23.     });
  24. }
  25. return false;