Hello,
<span id=”result_box” lang=”en”>I want to verify that a record does not exist in a database (mysql).
I used the event “beforeSubmit” but the return is still indefinite.
Have a suggestion?
Attached is the code</span>
Best Regards
$beforeform = <<< BEFOREFORM
function(postdata, formid)
{
function NomPrenomDate (nom, prenom, datenaissance) {
$.ajax({
type: “GET”,
dataType: ‘text’,
data: {q1:nom, q2:prenom, q3:datenaissance},
url: ‘g_nomprenomdate.php’,
success : function(response)
{
$(‘#clef’).val(response);
return [response];
}
}); }
var nom = $(‘#nom’).val();
var prenom = $(‘#prenom’).val();
var datenaissance = $(‘#datenaissance’).val();
var resultat = NomPrenomDate(nom, prenom, datenaissance);
if (resultat == “Non”) {return [true,””]; } else {return [false,”oui”+resultat]; }
}
BEFOREFORM;
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top