1

I have a node add form in Drupal 7, which is constructed of many fieldsets, which function as steps (jQuery show/hide on next/prev button clicks).

I added Parsley validation just as in Parsley multi steps form demo example.

The validation in the first steps works fine, but for every next step it stops the validation and lets you through, even if you don't fill in the required fields.

At the last step of the form, when you click on submit, the form doesn't submit and if you go back, you can see that all of the field were being validated at this moment.

I think after the first click on the next step the validation just waits for submit button and doesn't take into account that I have many steps.

Parsley part of the code:

  $('.next').on('click', function () {
    var current = $(this).data('currentBlock'),
        next = $(this).data('nextBlock');

    if (next > current)
     if (false === $('#node-add-form').parsley().validate('block' + current))
       return;

    $('.block' + current).addClass('hidden-step');
    $('.block' + next).removeClass('hidden-step');

  });
SimiS
  • 11
  • 4

0 Answers0