SHARE
TWEET

Untitled

a guest Jan 20th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //initialize validation
  2.   validators = [
  3.     $('#donation_amount').validate({ rules:{ amount: { required: true } } }),
  4.     $('#personal_information').validate({ rules:{ Street: { required: true } } })
  5.    ];
  6.    
  7. $('#btn-next').click(function() {
  8.     //if validation is true, show next page
  9.     if (validators[curOrder].valid()) {
  10.       var old = $('.active');
  11.       var oldOrder = old.attr('data-order');
  12.       var newOrder = parseInt(oldOrder) + 1;
  13.       old.removeClass('active');
  14.       $("[data-order='" + newOrder + "']").addClass('active');
  15.       curOrder = newOrder;
  16.     }else{
  17.       console.log("invalid");
  18.    }
  19. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top