Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

149
Visualizações
Get data from form on the callback from stepwise Bootstrap modal

I am using a bootstrap modal steps plugin stepwise

I've populated the steps per the docs with my form fields (truncated):

<div class="modal-body">
    <div class="row hide" data-step="1" data-title="This is the first step!">
      <form method="post" action="">
         <input type="text" id="name" name="name" class="form-control">
      </form>
    </div>
    <div class="row hide" data-step="2" data-title="This is the second and last step!">
        <form method="post" action="">
          <input type="text" id="email" name="email" class="form-control">
      </form>
    </div>
   <div class="modal-footer">
      <button type="button" class="btn btn-default js-btn-step pull-left" data-orientation="cancel" data-dismiss="modal"></button>
      <button type="button" class="btn btn-warning js-btn-step" data-orientation="previous"></button>
      <button type="button" class="btn btn-success js-btn-step" data-orientation="next"></button>
   </div>
</div>

Then initialise:

var callback = function (){
    console.log('Congratulations!');
   //get all form fields data here or call the save function with parameters
};

$('#modal-sample').modalSteps({
    completeCallback: callback
});

How can I get the data of the form on the final callback? I can use javascript and get the field data by id/class on each steps callback but that's a bit hacky. Ideally would like to call a function on the final step and pass some parameters in it. Because the next button is dynamic and becomes the final complete button I am not able to inject any function calls to it.

If I could add a onclick event on the final submit button then that would be better.

On the final step the data-orientation="next" becomes: data-orientation="complete"

Not very familiar with using callbacks, they mention validating fields on each step so I assume there is a way to check all fields but I am not sure how. Any help highly appreciated.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda