L
L
lavezzi12015-09-01 13:11:59
JavaScript
lavezzi1, 2015-09-01 13:11:59

How to open second modal after validation?

Hello.
There is a modal window with forms and a validator 1000hz.github.io/bootstrap-validator . The validator prevents the button from being clicked until the user enters the correct information. It is necessary after checking (if everything is correct), close the current window and display the second one, with gratitude. How to implement?

<input data-dismiss="modal" data-toggle="modal" data-target="#thanks" type="submit" value="Отправить" class="btn btn-primary btn-block">


I tried this code, the second modal window opens, and the first one closes everything as it should, but the validation does not work ..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Demidov, 2015-09-01
@Scrum

$('#form').validator().on('submit', function (e) {
  if (!e.isDefaultPrevented()) {
    $('#firstModal').modal('hide');
    $('#secondModal').modal('show');
  }
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question