I'm using modal Bootstrap and wanted to close and open the new modal information to be reset.
I have form
within modal, containing select
, textarea
, input
.
But when opening the modal of the bottom line, if the user modified something in the first modal it appears in the modal of the line below.
I used the command below
$('#myModalpv').on('hidden.bs.modal', function () {
location.reload();
})
But it does on the whole page, I would like it to reload, back up the modal in the initial state, when the user opens the next modal.
I also used the code below:
$('#myModalpv').on('hidden.bs.modal', function () {
$('#form2 input select').each(function() {
$(this).val('');
});
});
Cleared the information but did not return to the initial state of my modal.