close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

RegEx Client Validation WA Validation Toolkit

Thread began 9/15/2009 5:32 pm by BeDigital94844 | Last modified 9/17/2009 10:55 am by Jason Byrnes | 5236 views | 4 replies |

BeDigital94844Beta Tester

RegEx Client Validation WA Validation Toolkit

I am having a problem with validating a field (shipping address) on the checkout form page.
I am trying to block PO Box addresses when shipping via FedEx
the Regular Expression is as follows:

WAValidateRX(document.ecart_checkout_form.shipping_street1,'text','\\b[P|p]*(OST|ost)*\\.*\\s*[O|o|0]*(ffice|FFICE)*\\.*\\s*[B|b][O|o|0][X|x]\\b','- No PO Box delivery',document.ecart_checkout_form.shipping_street1,0,true);


any help would be grand- thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

try using this for your regular expression;
\s/[^((p\.o\.|po|post office|postoffice)\s*(box))]\s/i

Sign in to reply to this post

BeDigital94844Beta Tester

RegEx Client Validation WA Validation Toolkit

Thank you Jason.

I'm using - WAVT version 2.3.5
PHP version 5.2.10
Dreamweaver CS3

I've tried a number of regex- but not the one you sent- which I appreciate, and will let you know how it works.

Thanks again!

Sign in to reply to this post

BeDigital94844Beta Tester

RegEx Client Validation WA Validation Toolkit

Jason-

Thank you-

that worked perfectly, I see what is slightly different or what I missed.
I did not wrap the regex code between \s/ and \s/i

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it.


You where also missing the "^" character. your validation would only have worked for entering PO Box 123or some such, not prevent it. adding the in regular expresion[^] means "not" so my regular expression is looking for "not PO Box 123".

Sign in to reply to this post

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...