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

Help with a script for date field

Avatar

Avatar
Validate 25
Level 2
mmgiath
Level 2

Likes

6 likes

Total Posts

321 posts

Correct Reply

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

Avatar
Validate 25
Level 2
mmgiath
Level 2

Likes

6 likes

Total Posts

321 posts

Correct Reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
mmgiath
Level 2

16-12-2015

Is it possible when the display of a date field is not as: date{EEEE, MMMM D, YYYY}

then

Message: "Please select a date from the date calendar"

and focus on the date field

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

17-12-2015

I was thinking of the exit event, if you change the this.rawValue to xfa.event.change you could try using the calculate event ... which would mean they get the message sooner.

Either way they will still be able to cut-and-paste a date if it is in the correct format.

Bruce

Answers (2)

Answers (2)

Avatar

Avatar
Validate 25
Level 2
mmgiath
Level 2

Likes

6 likes

Total Posts

321 posts

Correct Reply

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

Avatar
Validate 25
Level 2
mmgiath
Level 2

Likes

6 likes

Total Posts

321 posts

Correct Reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
mmgiath
Level 2

17-12-2015

Bruce, Thank you again for all your help!

Do I have to use EXIT Event?

Thanks

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

16-12-2015

Hi,

You can try something like;

if (!this.isNull)

{

    var date = util.scand("yyyy-mm-dd", this.rawValue);

    if (date == null || this.formattedValue != util.printd('EEEE, MMMM D, YYYY', date, true))

    {  

        app.alert("Please select a date from the date calendar");

        xfa.host.setFocus(this);

    }

}

Regards Bruce