View previous topic :: View next topic
|
Author |
Message |
rahuindo
New User
Joined: 09 Apr 2008 Posts: 83 Location: Chennai
|
|
|
|
Hi,
I have the following requirement:
Display the date in the format MM/DD/CCYY.
The Map Field has a length of 10 bytes.
The same map will be used for View and Change.
For view, this field will be protected and for Change it will be unprotected.
During Change, the '/' should be always protected and user should be able to tab from Month to Date and to year.
Now, I have usually displayed the Date fields as follows:
MM / DD / CCYY which is 14 bytes and never as MM/DD/CCYY.
This is my problem.
Also, I cannot increase the lenght of the field due to restrictions on the map.
The other option I have is to display the date during Change as follows:
MM DD CCYY
But this will not meet the requirement during View as the date will not be populated with '/'.
Is there any solution? Or am I sounding confused |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
During Change, the '/' should be always protected and user should be able to tab from Month to Date and to year. |
the approach is just plain wrong...
You cannot have in this case a single field but 5 of them
3 for the input fields 2 for the separating slashes |
|
Back to top |
|
|
rahuindo
New User
Joined: 09 Apr 2008 Posts: 83 Location: Chennai
|
|
|
|
Hi Enrico,
You are right. We will need 5 fields and also the 5 fields cannot settle in the 10-byte field.
Hence, the approach I think is to display the date without slashes "09 30 2010" whenever the field has to be unprotected but display as "09/30/2010" when protected.
So, this would mean to define 3 fields in the map(A,b and C) when the date has to be unprotected and 1 field (D) when the has to be protected. Both fields have to be defined at same position of the map.
But the problems come when we are setting the attributes of the map.
I am not sure if there is a way by which we can suppress (i.e. do not display) the field D when A, B and C have to be displayed and vice-versa. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Use the same field definition for both cases.
When the field is unprotected, the code must make sure the date input is valid.
If you really want to be helpful to the user, you allow mmddccyy or mm/dd/ccyy or or mm dd ccyy when a date is modified. Even if it is presented to the user as mm/dd/ccyy. It is a tiny bit of code and the date must be validated anyway . . . |
|
Back to top |
|
|
rahuindo
New User
Joined: 09 Apr 2008 Posts: 83 Location: Chennai
|
|
|
|
Hi Dick,
I agree with your approach and had given a thought about it. I have kept this as the last option in case I do not find anything else.
Thanks!! |
|
Back to top |
|
|
|