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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Clear datefield if user choose wrong pattern (or validation fails)

kc_chaitu
Level 5
Level 5

Hi,

I have a date field for which i have set a particular pattern("DD/MM/YYYY").

I want to clear off  the entered value if user types in the value in wrong format.

I know this is possible in Designer 9.0 using

if (this.errorText != null)

then

this.rawValue = 0;   -- in the exit event

But, i'm using designer 8.2 for the current project and please advise how this can be made possible here.

Thanks,

kc

1 Accepted Solution
radzmar
Correct answer by
Level 10
Level 10

I don't think it's a good idea to restrict the entry format to only one pattern.

This will be frustrating the users, as the validation may fail too often.

It's better to make the entry as flexible as possible by combining several patterns:

As Edit pattern use:

date{DD.MM.YYYY}|date{DD:MM:YYYY}|date{DDMMYYYY}|date{DD MM YYYY}|date{DD-MM-YYYY}|date{DD,MM,YYYY}|date{DD/MM/YYYY}|date{DD.MM.YY}|date{DD:MM:YY}|date{DDMMYY}|date{DD MM YY}|date{DD-MM-YY}|date{DD,MM,YY}|date{DD/MM/YY}

and as display pattern:

date{DD/MM/YYYY}

Users so can enter dates in manifold ways but always get the displayed correctly as DD/MM/YYYY.

View solution in original post

2 Replies
radzmar
Correct answer by
Level 10
Level 10

I don't think it's a good idea to restrict the entry format to only one pattern.

This will be frustrating the users, as the validation may fail too often.

It's better to make the entry as flexible as possible by combining several patterns:

As Edit pattern use:

date{DD.MM.YYYY}|date{DD:MM:YYYY}|date{DDMMYYYY}|date{DD MM YYYY}|date{DD-MM-YYYY}|date{DD,MM,YYYY}|date{DD/MM/YYYY}|date{DD.MM.YY}|date{DD:MM:YY}|date{DDMMYY}|date{DD MM YY}|date{DD-MM-YY}|date{DD,MM,YY}|date{DD/MM/YY}

and as display pattern:

date{DD/MM/YYYY}

Users so can enter dates in manifold ways but always get the displayed correctly as DD/MM/YYYY.

View solution in original post

Niall_O_Donovan
Level 10
Level 10

Snap Radzmar - took the words out of my mouth