I've found out that in our OnePage checkout form, the validation is not strong enough. Validation checks if the required fields are filled correctly, then it checks email format and that's all it checks.
In this case, all fields with asterisk are checked whether they're filled or not. That's okay.
Then, there is a need for some format validation - email should be either xxx@yyy.zz, xxx@yyy.zzz or xxx@yyy.zzzz (in case of .info domain), phone number should contain numbers only and the same goes for post code.
Instead, email validation checks only whether the email consists of two words separated by at sign ("@"). For example, "test" won't pass the validation, but "test@test" without any domain is accepted by OPC, which is not enough.
Phone number format and post code format are not validated at all.
Did I do something wrong, am I missing some configuration? If not, are you planning to add better validation soon? If not, where can I do it myself without a component core hack?
I've searched through other topics and found that it's all up to tabcontent.js in my template folder (threecolumn_special_blue), which is referencing onepage.js - that's where is the RegExp to check the email format. However, I'm not really up for any OPC core JS hacking, not even a js file.
The RegExp that you could use would be just as simple as this (or anything else you like but also requiring .domain at the end of the email address)
- Code: Select all
new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-zA-Z]{2,4}$");
Thank you for any information about this!
Using Joomla 2.5.22, VM 2.6.6 and OPC 2.0.250.240614
Kind regards,
Tom