title: parsleyjs with multi steps form
body: <p>I'mn creating a multi step form wizard (using Twitter Bootstrap Wizard) and looking at the Parsley multi step example I'm not sure how I would implement it if I have more then two steps my current form has at least 4 steps.</p>
  
  <p>This is what I don't understand </p>
  
  <pre><code>&lt;span class="next btn btn-info pull-right" data-current-block="1" data-next-block="2"&gt;Next &gt;&lt;/span&gt;
  </code></pre>
  
  <p>My next button is constant</p>
  
  <p>Here is the parsley example </p>
  
  <pre><code>&lt;form id="demo-form" data-parsley-validate&gt;
    &lt;div class="first block1 show"&gt;
      &lt;label for="firstname"&gt;Firstname:&lt;/label&gt;
      &lt;input type="text" name="firstname" data-parsley-group="block1" required/&gt;
  
      &lt;label for="lastname"&gt;Lastname:&lt;/label&gt;
      &lt;input type="text" name="lastname" data-parsley-group="block1" required /&gt;
      &lt;span class="next btn btn-info pull-right" data-current-block="1" data-next-block="2"&gt;Next &gt;&lt;/span&gt;
    &lt;/div&gt;
  
    &lt;div class="second block2 hidden"&gt;
      &lt;label for="fullname"&gt;Email:&lt;/label&gt;
      &lt;input type="text" name="fullname" required  data-parsley-type="email" data-parsley-group="block2" /&gt;
      &lt;span class="next btn btn-info pull-left" data-current-block="2" data-next-block="1"&gt;&lt; Previous&lt;/span&gt;
      &lt;input type="submit" class="btn btn-default pull-right" /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function () {
    $('.next').on('click', function () {
      var current = $(this).data('currentBlock'),
        next = $(this).data('nextBlock');
  
      // only validate going forward. If current group is invalid, do not go further
      // .parsley().validate() returns validation result AND show errors
      if (next &gt; current)
        if (false === $('#demo-form').parsley().validate('block' + current))
          return;
  
      // validation was ok. We can go on next step.
      $('.block' + current)
        .removeClass('show')
        .addClass('hidden');
  
      $('.block' + next)
        .removeClass('hidden')
        .addClass('show');
  
    });
  });
  &lt;/script&gt;
  </code></pre>