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

Date Field YYYY only and validation message.

Avatar

Avatar
Validate 1
Level 1
PCForm
Level 1

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
PCForm
Level 1

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
PCForm
Level 1

24-02-2016

I have a date field "Policy Term" formatted as MM/DD/YYYY. And another text field "Year Built" no format.

I need to write a script for this scenario.

If the "Year Built" > the "Policy Term" (YYYY format) date field, it will give a validation message " " then "xfa.host.setFocus(this)" to the Year Built field.

View Entire Topic

Avatar

Avatar
Validate 1
Level 4
jasotastic81
Level 4

Likes

35 likes

Total Posts

329 posts

Correct Reply

43 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
jasotastic81
Level 4

Likes

35 likes

Total Posts

329 posts

Correct Reply

43 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
jasotastic81
Level 4

04-03-2016

Do you need an actual validation message that prevents submitting?

If not, here's a quick option. I'm presuming this is an event that is called by the Year Built field since you used "this" as the parameter for your function.

if (this.rawValue > parseInt(dfPolicyTerm.rawValue.substr(0,4))){

  xfa.host.messageBox(" ");

  xfa.host.setFocus(this);

}