T
T
tr1ck12017-07-16 22:38:15
PHP
tr1ck1, 2017-07-16 22:38:15

Is there a general command to reset the text in windows that close and then reopen without refreshing the page?

Hello! What can be done so that when opening a window, entering text there, closing it and reopening (without refreshing the page), all information is reset? Is there a general command or should I write it separately for each window? Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Ernest Fayzullin, 2017-07-16
@ernesto77

Here's an idea (not tested)

document.onload(function (event) => {
  $('input, select, textarea').val('');
});

only not when opening a page, but when opening a window with a form

V
Vladimir, 2017-07-16
@djQuery

Many, if not all, modals have beforeShow events. Clear input fields on this event.

@
@kotmail, 2017-07-17
_

$('form').trigger('reset');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question