I fill several <select>
together with others <input>
inside a <form>
modal window with data from the server. I use the same form to display the data of a selected record and to enter a new one.
After displaying a selected record, when exiting the modal, I want to reset all the <input>
and <select>
and leave it ready in case they want to enter a new record.
For this I use $('#id_miformulario')[0].reset();
and also $('#id_miformulario').trigger('reset');
but it only resets the <input>
, it <select>
leaves them with the text brought from the server in the query.
I used $('#id_miinput').text('');
to reset those <select>
and it does but then it doesn't load the default data from the server.
What am I doing wrong?
I hope you find it useful and it is what you need to do...