Announcement

Collapse
No announcement yet.

field control

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

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

    PHP Code:
    // 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
    Last edited by kafecadm; 07-08-2015, 03:37 PM. Reason: missing semicolon at the end of the $query line

    Comment


    • #3
      Originally posted by kafecadm View Post
      create an ajax onchange event for your field email and add code to validate, something like:

      PHP Code:
      // 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
      // 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");
      }

      Comment


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

        Regards

        Comment

        Working...
        X