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

Focus after validation error

Avatar

14-10-2008

Is it possible to re-set focus to an object after a validation (pattern) error? I don't want the user being able to exit an object when there is a validation error.

Replies

Avatar

20-10-2008

-Bump-



Is this not possible to do or do I need to clearify my problem? 🙂

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

21-10-2008

Try using xfa.host.setFocus("fieldname")

Avatar

21-10-2008

Hi!



The problem isn't to set focus to the control but to set focus after the pattern validation. Is there any way to determine if the pattern validation errors and then set focus?



As it is now, a dialog shows and says "Your postalcode must be 5 digits" and then the cursor jumps to the next textfield. I want the cursor to return to the control that didn't verify correctly.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

22-10-2008

To be able to do that you will have to use scripting validation instead of the built in validation.

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

27-10-2008

The easiest way to convert a picture validation to a script validation is to use the formcalc format() function.

E.g. the formcalc script to validate a US zip code would look like:



format("text{99999}", $) <> ""

Avatar

28-10-2008

That's a pretty big job to do that but I am starting to realize that I don't have any other option. Thanks for your help!