J
J
Juniorrrrr2020-04-14 08:59:47
JavaScript
Juniorrrrr, 2020-04-14 08:59:47

How does value caching work in input?

The task was set to make it so that when you re-enter the same value, the old value drops out and you can select it.

I always thought that this is the default behavior of the input. The project uses PHP and Reactjs . I came across
the autoComplete attribute on the input, but why it didn’t help.
This is what the input itself looks like

<input
   type="text"
   placeholder="введите значение"
   onChange={onChange}
   value={value}
   autoComplete="on"
/>


Actually, such questions arose:

1) There is a difference in whether to raise the project locally or on the server in terms of caching the value in the input.
2) Is this the default behavior of the input or the browser?
3) At what point is the value cached? We just entered a value and it is already cached, or do we need to send data? If you need to send, then is there a difference between the old way of sending via action and submitting the form and the fetch method
4) Does the back participate in the caching of the input's value?
5) And actually the main question is how to overcome this problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question