It seems it is not the correct coded when I transform $ into jQuery.
Which code is actually correct when using jQuery.noConflict();
Code is validated and it works but need to add $ = jQuery; in the correct way.
$(function ()
{
var $sections = $('.form-section');
function navigateTo(index) {
$sections
.removeClass('current')
.eq(index)
.addClass('current');
$('.form-navigation .previous').toggle(index > 0);
var atTheEnd = index >= $sections.length - 1;
$('.form-navigation .next').toggle(!atTheEnd);
$('.form-navigation [type=submit]').toggle(atTheEnd);
}
function curIndex() {
return $sections.index($sections.filter('.current'));
}
$('.form-navigation .previous').click(function()
{
navigateTo(curIndex() - 1);
}
);
$('.form-navigation .next').click(function()
{
if ($('.demo-form').parsley().validate('block-' + curIndex()))
navigateTo(curIndex() + 1);
}
);
$sections.each(function(index, section)
{
$(section).find(':input').attr('data-parsley-group', 'block-' + index);
}
);
navigateTo(0);
}
);
Need help.