Skip to main content
May 13, 2008
Answered

Spry Form Validation

  • May 13, 2008
  • 3 replies
  • 544 views
Hi,

Does anyone know how to use the Spry Custom Pattern to validate an International Phone Number (to allow '+'00 000 0000, if that's what the user wants to enter,or any other format, etc)?

Thanking anyone in advance!

LittleMookie
This topic has been closed for replies.
Correct answer Newsgroup_User
An approach might be to do the validation for each of format, save each
validation procedure then write a handler to select. Each of the
foramts is a defferent length. So maybe in mock code

if fld.len = 6 then
call function1
else
if fld.len = 9 then
call function2

else
if fld.len 10 then
call function3
else
error routine


etc, etc.


littlemookie wrote:

> That's what I'd thought, thanks for your input though, much
> appreciated! Cheers
> Samuel



--

3 replies

Inspiring
May 16, 2008
You you want to allow any one of the three patterns at run time?

littlemookie wrote:

> Hi Philo,
>
> Sorry, I'm a bit of a Newbie when it comes to this sort of thing.
> I've had a look at the Help file, and understand which Value means
> what, but I'm not sure how to put the Custom Pattern together to
> allow all of these: +44 1989 123456
> 44 1989 123456
> 01989 123456
> Do you know if this is possible, or do you have to use one phone
> format? Cheers



--

May 19, 2008
Hi Philo,

Yeah, I guess that's what I need . . .to validate the input, but to alow the user several options as previously stated. As the phone number might be international, they may or may not want to use the '+' prefix, so I would like to accomodate this. . . .is it possible?

Cheers

Samuel
May 14, 2008
Hi Philo,

Sorry, I'm a bit of a Newbie when it comes to this sort of thing. I've had a look at the Help file, and understand which Value means what, but I'm not sure how to put the Custom Pattern together to allow all of these:
+44 1989 123456
44 1989 123456
01989 123456
Do you know if this is possible, or do you have to use one phone format?
Cheers
Inspiring
May 13, 2008
I have made several custom validation. Just go to the help, there is
quite a bit of info and it is where I got my info.