Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!