Module: Basket - Email validation issues

wabaki

Joined: 2014-01-09
Posts: 2
Posted: Thu, 2014-01-09 04:27

Hi everybody!

I need some help with the email validation of the basket module at checkout...
The module doesn't accept emails that contain a dot in the name... Example:

Can anybody tell me where can I find the validation form for the email address field so that I can correct it?

Thanks in advance!

 
wabaki

Joined: 2014-01-09
Posts: 2
Posted: Thu, 2014-01-09 11:31

So, Hi again :)

In case there's anybody out there who has the same problem, I have solved it...

The actual problem was not the dot in the email address but the fact that the form validation says : before the dot anywhere in the email address have to be more than 2 characters so that makes

an invalid email because 'me' is only 2 characters....

Ps. I find this form validation twisted sick!

So, this is my version of the validation form: (you have to replace the code in 'modules/basket/views/checkout.html.php'

<SCRIPT language="JavaScript">

/**

* www.wabaki.com

*/
function ive(s)
{
return (s.indexOf(".")>0)&&(s.indexOf("@")>0);
}
function se(v)
{
v.style.backgroundColor="#FAA";
}
function re(v)
{
v.style.backgroundColor="#FFF";
}
function ci(v)
{
if ((!v.value) || (v.value.length==0)) {se(v);return false;}
re(v);
return true;
}
function so(g){
var p=true;
var d=document.checkout;
if(!ci(d.fullname)){p=false;}
if((!ci(d.email))||(!ive(d.email.value))){se(d.email);p=false;}
if(!ci(d.phone)){p=false;}
if (p)
{
d.paypal.value=g;
d.submit();
}
}
</SCRIPT>

Despite of this validation issue and a few more difficulties, I find this script and the basket module really cool so... thanks for sharing!