Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

add NONE field in zip validation

Featured Replies

hi @LL,

we are using simple code for validation in zip, but now we want to be able to type the word

"NONE" also.

How this code can be modified to do that?

case 'zip':

if ($inString=='') { appendError("Required Field"); }

else {

$length=strlen($inString);

switch($length)

{

default:

appendError("Must be 5 digit zip '00000', or zip+4 '00000-0000' or 'NONE'");

break;

case '5':

$pattern="^[[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]]$";

$emailTest=ereg($pattern, $inString);

if (!$emailTest) { appendError("Only numbers allowed in zip"); }

break;

case '7':

$pattern="^[[:digit:]][[:digit:]][[:digit:]][[:space:]][[:digit:]][[:digit:]][[:digit:]]$";

$emailTest=ereg($pattern, $inString);

if (!$emailTest) { appendError("Canadian postal codes must be three digits, one space, three digits"); }

break;

case '10':

$pattern="^[[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]]-[[:digit:]][[:digit:]][[:digit:]][[:digit:]]$";

$emailTest=ereg($pattern, $inString);

if (!$emailTest) { appendError("Not a valid Zip+4 format"); }

break;

Thanks

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.