Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda