Continue with ajax request, after validations in php

0

How could I build a form that after collecting the form data, send them by means of an AJAX request to a PHP file and this in turn validates them in the BD, return a response and this response is sent to an HTML message with validation buttons and after choosing one of these buttons continued or not with the same request AJAX request?

An example:

Suppose I have a customer registration form, when sending my AJAX request to register the client, first PHP validates the database to verify if the name exists, after doing it, it shows me that there is already a person registered with the same name, then I get a message in the FRONT commenting that there is an equal name in my database and I am asked if I want to continue with the registration (duplicate the name), if I confirm, then continue with the record.

My question is whether this is possible with the same AJAX request, or I would have to build another one.

    
asked by Ivan Arteaga 25.11.2017 в 17:45
source

0 answers