close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

ecart 6 uk phone number validation

Thread began 2/13/2014 6:17 am by CraigR | Last modified 5/25/2016 1:29 pm by Ray Borduin | 971 views | 11 replies |

CraigRBeta Tester

ecart 6 uk phone number validation

by default, the wizard created pages request a 10 digit phone number, so not good for the UK

It would be nice to have the option in the set up, but for now, how do I change the validation, and the display pattern of the entered number for UK ?

Sign in to reply to this post

Jason ByrnesWebAssist

On the checkout page, go to WebAssist -> Forms -> Jquery Validation to edit the jquery validation settings for the form on the checkout page.

select the phone number field, and change the format.

Sign in to reply to this post

CraigRBeta Tester

i looked up the regex codes for a uk number, and this seems to be ok.

However on blur, the code still formats itself to the original layout, x (xxx) xxx-xxxx and it doesn't seem to be editable via the method you described.

unfortunately, there is no single layout which will work for the uk, as the area code can consist of 2, 3 4 or 5 digits

Sign in to reply to this post

Jason ByrnesWebAssist

the format is set in the onblur code:

onBlur="WAValidatePN(document.getElementById('CheckoutWizard_NewFromBlank_Default').Phone_Number,'',false,true,'x (xxx) xxx-xxxx',document.getElementById('CheckoutWizard_NewFromBlank_Default').Phone_Number,0,true);"


you could remove the format there.

x (xxx) xxx-xxxx

if no one format will work for you, then you could remove the phone number requirement and make it required, but not force phone number.

Sign in to reply to this post

CraigRBeta Tester

Thanks Jason

I just wanted to check that the onBlur code block wasn't editable via the interface

Sign in to reply to this post

Jason ByrnesWebAssist

I dont believe it is editable through the interface.

Sign in to reply to this post

Dave W

Hi Jason, With regards to UK telephone numbers I find that the following seems to work well in eCart 6.0.6

Open the jquery.h5validate.js file and change the phone regex to:
/^(((\+44\s?\d{4}|\(?0\d{4}\)?)\s?\d{3}\s?\d{3})|((\+44\s?\d{3}|\(?0\d{3}\)?)\s?\d{3}\s?\d{4})|((\+44\s?\d{2}|\(?0\d{2}\)?)\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$/

Next in the checkout.php page in the telephone input change the following:
Change the pattern to "\d{5} \d{6}" (British phone number normally have 11 numbers starting with a 0)

In the validate part of the input change x (xxx) etc to 'x xxxxx xxxxxx'
I find that this works well and cover mobile numbers as well.
Hope this helps anybody with the same problem
Regards,
Dave

Sign in to reply to this post

CraigRBeta Tester

Thanks for this Dave, I'll take a look

Sign in to reply to this post

Dave W

Let me know how you get on with it Craig.

Sign in to reply to this post

Anthony

Could you advise if there is a quick fix for this in ecart 6 now. I've tried editing jquery validation and edited the checkout onblur but area but still won't except
p uk and keeps defaulting to us format although removed from above. Help would be much appreciated

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...