I am trying to use Validation jQuery plugin with flash card. This is my code:
email: { required: true, email: true, remote: { url: $.getJSON($SCRIPT_ROOT + "/_check_mail"), } },
This request should be sent to servers that check if mail exists in the yes or no database:
@app.route('/_check_mail') def check_mail(): mail = request.args.get('email') check = database.check_mail(mail) return check
The control variable is set to True if the mail does not exist and contains the string "This mail already exists." If mail already exists.
However, when I try to send this to the server, I get this error message:
- Request URL: http://0.0.0.0: 5000 / [object% 20Object]? email = arnoutaertgeerts% 40gmail.com
- Request Method: GET
- Status Code: 404 NOT FOUND
Already tried some other things, but nothing worked. Any ideas?
I think I can get it to work with the costum method, but then I need to execute a synchronous AJAX request ...
jquery python jquery-validate flask
arnoutaertgeerts
source share