L
L
lemonlimelike2017-11-26 22:59:27
Python
lemonlimelike, 2017-11-26 22:59:27

How can I make the form not close after clicking?

Hello. I did the authorization, 5a1b1c66708e3492320902.jpegeverything is fine, now you need to do a password recovery. By clicking on the button "Forgot your password?" pops up this modal window. 5a1b1ca0b3c96506819040.jpeg
I did so, after the user has entered the data, another field appears in the form, such as enter your new password. But this modal window after submit reloads the page. How to make it not reload the page? By ajax?

PS... after entering the data and clicking on submit, the page reloads, and when you click on the button again, another field appears

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Yakushenko, 2019-09-10
@duzive

You need to use any database. The principle is this:
When any user accesses the bot, his ID is recorded in the database, as soon as he receives the necessary information, it is written to the table, for example, time.time()and every time the user accesses the bot, something like this check occurs:

if (time.time() - last_update) >= 86400:
    print('Ты снова можешь получить подарок:)')
else:
    print('Ты уже получал подарок')

For such purposes, any database is suitable, you can try SQLite - it is very simple.

T
tema_sun, 2017-11-26
@tema_sun

Whatever you want, of course, can be done. You need to do this by sending an ajax request.
But here it is:
bad decision.
Send the user a unique one-time link where he can set a new password.

P
Pazzik, 2017-11-27
@Pazzik

https://developer.mozilla.org/ru/docs/Web/API/Even... so that the page does not reload when the button is clicked.
+ ajax to make the request itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question