1
I am using Bootstrap modal and wanted to close and open the new modal information be reset.
I have a form
within the modal, containing select
, textarea
, input
.
But when opening the modal from the bottom line, if the user modified something in the first modal it appears in the modal from 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 you to do the Reload, turn 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.
Precisely what information?
– Woss
Do you want to Reload or clear fields? And it’s only in the modal window?
– Jorge B.
Correct Jorge, I have a <form> inside the modal with input, textarea, select, but when I open the modal of the line below it still contains the information that was modified when opened the modal previously.
– Junior