field control

I created a form to register users, I have an email field, I would like first to confirm data entry in the database you were in control if there is a field email with name already 'present in this case have error message

create an ajax onchange event for your field email and add code to validate, something like:


// lookup for the email in the database
$query= "SELECT email FROM myTable WHERE email = '" . {myeMailField} . "'";
sc_lookup (find, $query);

//
if ( isset( {find[0][0]} ) )
{
    sc_error_message("Are you kidding me?... you registered already you fool ;D");
}
else
{
   // do nothing
}

hope this helps…

Regards

[QUOTE=kafecadm;38406]create an ajax onchange event for your field email and add code to validate, something like:


// lookup for the email in the database
$query= "SELECT email FROM myTable WHERE email = '" . {myeMailField} . "'";
sc_lookup (find, $query);

//
if ( isset( {find[0][0]} ) )
{
    sc_error_message("Are you kidding me?... you registered already you fool ;D");
}
else
{
   // do nothing
}

hope this helps…

Regards[/QUOTE]

// lookup for the email in the database
$query= “SELECT email FROM anagrafica WHERE email = '” . {email} . “’”;
sc_lookup (find, $query);

//
if ( isset( {find[0][0]} ) )
{
sc_error_message(“Email inserita esiste”);
}

yes something like that… oh and btw I would add something similar in the onvalidateevent of your form.

Regards