/**
 * Tab as steps
 */
IGDATAPOOLFE.plugins.add('stepButton', {
    form: null,
    initFields: function(form) {
	this.init(form);
    },
    init: function(form) {
	let $form = $(form);
	this.form = $form;
	var $stepInput = $('input.currentStep');
	var currentStep = parseInt($stepInput.val());
	$('.dp-button-prevStep', $form).click(function(e) {
	    e.preventDefault();
	    $stepInput.val(currentStep - 1);
	    $('form', $form).submit();
	});
	$('.dp-button-nextStep', $form).click(function(e) {
	    e.preventDefault();
	    $stepInput.val(currentStep + 1);
	    $('form', $form).submit();
	});
    }
});