如何使用Jquery向导步骤进行验证

时间:2019-06-19 05:39:12

标签: jquery wizard jquery-steps

如果您在输入中没有写任何内容,但我无济于事,我试图使Jquery步骤不前进。

http://www.jquery-steps.com/Examples

 if (newIndex === 2 && $("#Rua").val() == "") {
    return false;
 }

$(document).ready(function() {   

  $("#wizard").steps({

      headerTag: "h2",
      bodyTag: "section",
      transitionEffect: "slideLeft",
      stepsOrientation: "vertical",
      labels: {
        current: "current step:",
        pagination: "Pagination",
        finish: "Finalizar",
        next: "Confirmar",
        previous: "Voltar",
        loading: "Carregando ..."
      },
      onStepChanging: function(event, currentIndex, newIndex, cepError) {
        if (currentIndex > newIndex) {
          return true;
        }

        if (newIndex === 1) {
          return true;
        }

        if (newIndex === 2 && $("#Rua").val() == "") {

          return false;
        }

      }
    }

  )
});

0 个答案:

没有答案