Expand my Community achievements bar.

SOLVED

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

Avatar

Former Community Member

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

Avatar

Correct answer by
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

Avatar

Correct answer by
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.

Avatar

Level 10

Snap Radzmar - took the words out of my mouth