1
I have the following button:
<button type="submit" class="btn btn-info pull-right"><? echo $titulo; ?></button>
This button sends a form action, with the completed data.
And I also have the following field:
<input type="text" class="form-control" name="con_email" id="con_email" placeholder="E-mail da Consultora" value="<? if(isset($dados->con_email)){ echo $dados->con_email; } ?>" required>
I need you to press the Ubmit button and run a check to see if this e-mail already exists in the database. I know it is possible to elaborate this in jQuery, but I don’t know where to start the check.
I thought only when sending, I do the search via php and return true or false, returning, true, I just call a modal, returning false, call the ajax to Insert in the database, using the get method or post.
Does anyone have any idea how I can craft this jQuery?
Your logic is right, now is implementation detail, depends on the way you usually do, in short it will be a request to validate the email and another to send the form. and the form depends on the email.
– Gabriel Rodrigues
Exactly, but I think about validating, if it comes true (1), I print the message if not I do the inclusion, via jquery itself.. php I work it, as needed, what I don’t know how to develop would be this jquery. :)
– Sr. André Baill
I make everything work first without jquery/Ajax, with all the necessary validations on the server side, then I make Ajax send the original form and handle the return, the end result is that everything works exactly the same even if it is without js.
– Jader A. Wagner