S
S
Sergey Suntsev2017-06-16 07:53:30
JavaScript
Sergey Suntsev, 2017-06-16 07:53:30

When is the best time to send a request to change the text in an input?

There is an input field, the user enters data into it and this data is sent to the server on the go.
The question is, at what event to send data? Only onBlur or OnChange comes to mind.
But in the first case, the data may be sent too late, and in the second, a lot of requests have to be sent.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Frozen Coder, 2017-06-16
@GreyCrew

Call submit in onChange. Google towards the implementation of debounce, for example, lodash has it.

A
Arsen Abakarov, 2017-06-16
@ArsenAbakarov

onInput, wrap in desired timeout

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question