N
N
Nikolay Ladohin2015-03-30 17:40:14
JavaScript
Nikolay Ladohin, 2015-03-30 17:40:14

Validation in JS, how to make sure that user data is saved in the input field?

I must say right away that I am slightly less than weakly familiar with JS.
There is a certain form with several input fields, such as "first name", "last name", "password", "date of birth", etc.
Each field is checked with simple if/else constructs and, accordingly, if the data does not pass the check, a corresponding warning window appears. If they pass, the field is reset to zero. So here's how to make sure that correctly entered data remains in the field when re-filling incorrectly filled fields? That is, so that the user does not have to enter the first and last name twice just because the first time he made the password wrong?
Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
skynetdev, 2015-03-30
@arviezu

I think the best option would be to use PHP,
but since you need JS, then I think it’s more correct to drive the values ​​\u200b\u200bin localStorage
and then take them from there
htmlbook.ru/html5/storage
is the best option for JS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question