This topic is locked

ZIP CODE Validation Flags on Non-Required Field

9/16/2007 8:59:21 PM
PHPRunner General questions
M
MikeB941 author

Hello:
I have two address fields, one required and one optional and I have tried to apply validation to both with the following problem:
If I turn US ZIP CODE validation on for my non-required address it flags the zip code as invalid if nothing is entered.
The US STATE validation works as I would expect however, IF something is entered in a NON-REQUIRED state field it will validate and respond accordingly. If the state is left empty on a NON-REQUIRED field validation is note performed.
Thanks for any help.
Take Care... Mike.

Alexey admin 9/17/2007

Mike,
thank you for pointing me to this bug.

We'll fix it with the next update of PHPRunner.
SSN validation should allow empty user input.
To get your pages working modify validate.js file in C:\Program Files\PHPRunner4.1\source\include folder.
Find this line there:

if (validateObject.type.indexOf("IsSSN")>=0)

and replace it with:

if (validateObject.type.indexOf("IsSSN")>=0 && isWhitespace(validateObject.val)!=true)


Then rebuild your project.