Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to find out if a pattern validation failed

Avatar

Avatar
Level 2
_Edgar_van_Waar
Level 2

Likes

0 likes

Total Posts

32 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
_Edgar_van_Waar
Level 2

Likes

0 likes

Total Posts

32 posts

Correct Reply

0 solutions
View profile
_Edgar_van_Waar
Level 2

23-02-2009

Hello,



I have Designed a form with several pattern-validations on it. LC's default behavior on such validation is that a message will be shown, but the user is still allowed to leave the field. Even if the entered data is crap.



So is it there any way to clear the field after a validation error or enforce the user to go back to the field?



I know it it possible to mark the validation as an error, so submitting will refuse. But in my case I have a custom submitting procedure, so this won't work.



Thanks for your help.

Replies

Avatar

Avatar
Affirm 3
Level 2
JohnBrinkman
Level 2

Likes

0 likes

Total Posts

20 posts

Correct Reply

3 solutions
Top badges earned
Affirm 3
Affirm 1
View profile

Avatar
Affirm 3
Level 2
JohnBrinkman
Level 2

Likes

0 likes

Total Posts

20 posts

Correct Reply

3 solutions
Top badges earned
Affirm 3
Affirm 1
View profile
JohnBrinkman
Level 2

25-02-2009

Edgar:



Instead of using a validation picture, you could put the logic in a FormCalc validation script and use the format() method. Then if it fails you can clear the field and setFocus() back into the field.



Alternatively, you could use a display picture and your validation script could compare rawValue with formattedValue. If a display picture fails, then rawValue and formattedValue will be the same.

I've described this in more detail (with a sample) at:



http://blogs.adobe.com/formfeed/2009/02/calling_formcalc_functions_fro.html



John Brinkman