Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Spry Form Validation

Guest
May 13, 2008 May 13, 2008
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
TOPICS
Server side applications
543
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 20, 2008 May 20, 2008
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



--

Translate
LEGEND ,
May 13, 2008 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 14, 2008 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 16, 2008 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



--

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 19, 2008 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2008 May 19, 2008
From the help I don't see a way. A google only brought up your
quetion. Sound like some programing to me.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 20, 2008 May 20, 2008
That's what I'd thought, thanks for your input though, much appreciated!
Cheers
Samuel
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 20, 2008 May 20, 2008
LATEST
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



--

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines