Answer the question
In order to leave comments, you need to log in
How to set a time interval, at the end of which, it will be possible to press the button and move on?
The essence of the problem is as follows:
There is a button by which the new user goes to the "Passing the survey" page. After the transition and answers, return and changes on this page are possible only after a certain time after the previous answers on the page.
For example, I clicked the "Continue" button, went to the "Questionnaire" page, filled it out and was redirected to another page. Now I can see the "Questionnaire" page and change something only 1 hour after the previous filling of the Questionnaire.
Actually a question - How to set time and what method?
Thanks in advance for your reply and your time spent on me.
Answer the question
In order to leave comments, you need to log in
Method 1 (like this):
Use localStorage or sessionStorage , store a datetime variable in it and check this variable inside the application, for example, when a button is pressed.
Method 2 (also so-so):
You need to store datetime in the database, on the server and add a worker that will compare the time and add a webhook - which will send changes to the application.
Again, these methods are redundant. If the user can change the profile only in the session, the easiest way is to store a local variable and hang the event.
For example, I clicked the "Continue" button, went to the "Questionnaire" page, filled it out and was redirected to another page.
Now I can see the "Questionnaire" page, and change something, only after 1 hour
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question