email validation when user registers
« on: April 24, 2014, 04:42:32 AM »
Hello,

Is there a script to put in to vaidate users emails before sending the form?  since they had been telling me that they write the wrong email but they didnt check it before so they never get the confirmation mail :S

*

Vink

  • *****
  • 329
    • NedDate.nl
Re: email validation when user registers
« Reply #1 on: April 25, 2014, 11:16:16 AM »
Hi

You can do this with:

Code: [Select]
var x=document.forms["frmContact"]["txtemail"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {ldelim}

   alert("Emailaddress misspelled? ");

  return false;
  {rdelim}

where frmContact = your form name
and txtemail = your input tekst email field name

put the code in your form validation.
 
 
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

Re: email validation when user registers
« Reply #2 on: October 27, 2014, 03:53:53 PM »
Hi

You can do this with:

Code: [Select]
var x=document.forms["frmContact"]["txtemail"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {ldelim}

   alert("Emailaddress misspelled? ");

  return false;
  {rdelim}

where frmContact = your form name
and txtemail = your input tekst email field name

put the code in your form validation.
 
 

hi vink, can you tell me what file i out this code into? thanks,

*

Vink

  • *****
  • 329
    • NedDate.nl
Re: email validation when user registers
« Reply #3 on: October 27, 2014, 09:49:20 PM »
Hi
It depends on with form you want to apply it.. there are several forms in osDate .. feedback.tpl, signup, forgot password ect ect
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91