Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

DATE VALIDATION dd/mm/yyyy (date field with manual entry)

Avatar

Former Community Member
Is there a way to stop people filling in date fields manually?

since there is a calendar, there not only is no need for manual entry but it also avoids input error..



When I try to validate a date, it will either accept the manual date, or the calendar date but never both.



Does somebody have a solution for this? .. either to validate both the calendar date & manual entry (entered in dd/mm/yyyy)



Or

to prevent users from typing inside the date field (& use the calendar!)

(or prevent them from typing anything other than dd/mm/yyyy)



('ve tried regular expressions but it does not accept the value from the calendar)



Thanks hopefully!
33 Replies

Avatar

Former Community Member
Hello Chris,



Adobe Acrobat/Reader allow to user entry date from calendar and manual entry.



You can set the patterns for display, edit, data, and validation pattern. There are many pattern samples in Designer.



If you set edit pattern same as validation pattern, if user entry the wrong date format, a warning dialog will appear.



Hope that help!



William

Adobe System

Avatar

Former Community Member
Hi there,



I am having a similar problem with date validations.



As, you mention, you can set the edit pattern and validation pattern the same and an error does appear, however, the cursor skips to the next field without allowing you to fix the error.



You then have to re-position your cursor back on the date field and select to correct.



Why isn't there a feature to validate like a mask field in Microsoft Access?



Thanks,

Ric

Avatar

Former Community Member
Hi @ all



Help me pls!



how can i disable the Calender, in the Date-Field?

i want only the formate, but not this calender!



thx



luny

Avatar

Former Community Member
Hi,



Under the Binding tab set Data format to Date and Time.

Avatar

Former Community Member
Thank you!

But now I can type letters to. I would just numbers and "points".

I want the Dateformat..



Anybody know a good solution?



thx,

luny

Avatar

Former Community Member
HELP ME PLS :D



HOW CAN I DEFINE THE FORMAT IN THE FIELD.



THERE ONLY ACCEPT NUMMBERS AND "POINTS" .

Avatar

Former Community Member
Hi there,



I share your frustration in getting help with Livecycle Designer.



I had to switch to a different technology because I have found that Acrobat just doesn't cut it for real workd developement.



It has rich features, but not unfortunately, the rich features developers need.



Sorry I can't help you.



Thanks,

Ric

Avatar

Former Community Member
I realize it has been months, since the last post, but I'm trying to understand the exact issue. Correct me, if I'm wrong, but you would like to limit the user to only entering the date by the calendar, or limiting them to only manual input. Just not both. If that is the case, unfortunately, there is no way to a) turn off the calendar, and b) prevent manual input.

Avatar

Level 7
Well, have you tried just using a palin text field and writing your own validation, key stroke and format scripts?

Avatar

Former Community Member
I just made it a Text Box field and validated the date with Javascript. Of course, I'm an old COBOL programmer and I know how to do that. ;) The user can enter MMDDYY, MMDDCCYY, MM/DD/YY, MM/DD/CCYY or replace the / with a dash (-), dot (.), or space. Javascript has a date function that converts a string to a "date". If the function fails, the string was invalid.

Avatar

Level 8
Dear All,



I have serious problem with Date/Time Fields. It seems that Date/Time Fields just DO NOT work properly. I am using Windows XP, with Arabic Language Support Enabled and LiveCycle Designer 7.1.



I am facing all kind of errors/problems with Date/Time Fields. I decided to switch my Regional Settings to English UK and also tried English USA, but still same result.



If I use a plain Date/Time Field, and try to make any data entry during runtime, the input is always converted to format "dd-mm-yyyy" and the numerals are converted to Indian Digits (Arabic/Indian Shapes). And, when I try to use Date Patterns for display, edit and validation, nothing works as per the documentation.



In summary, the Date/Time Fields do not work as per the documentation.



I tried for normal text and numeric fields, they do work as per the documentation. But, Date/Time Fields do not work at all, and all what I get is incorrect display or entry or always I get validation error.



Can some one tell me what is going on ????



PLEASE HELP !



Tarek.

Avatar

Former Community Member
I have the same problem. What java script did you use to check the data

Avatar

Level 8
By chance, and not sure exactly what solved the problem of working with Date Fields, I think when I made a small MS Access Table with Date Fields, and exported it to XML with Schema info, and created a connection to this XML/Schema from Adobe LiveCycle Form, then the Data Fields worked properly, but honestly, not sure exactly.



However, in my previous project, I used the functions in FormCalc to convert String input to Date Variable, and do the Validation. You could do that in JavaScript, but it is a bit more difficult.



Tarek.

Avatar

Former Community Member
Not an exact solution. Needs a little work to prevent text characters:

~ works for dd/mm/yyyy; if not that format set field to null.



var DD = parseFloat(this.formattedValue.substr(0,2));



var MM = parseFloat(this.formattedValue.substr(3,2));



var YYYY = parseFloat(this.formattedValue.substr(6,2));



if(DD > 31 || DD < 1)



{



this.rawValue = null;

}



if (MM > 12 || < 1)



{



this.rawValue = null;



}



// if string length not 10 cant be correct



if (this.formattedValue.length != 10)



{

this.rawValue = null;



//look for first /



if( this.formattedValue.substr(2,1) != "/")



{



this.rawValue = null;



}



//look for second /



if( this.formattedValue.substr(5,1) != "/")



{



this.rawValue = null;



}



}

Avatar

Level 7
If you check the Adobe documentation pages for LiveCycle Designer there are many documents about creating forms in LiveCycle Designer.



"E" one digit day or week

"EEE" abbreviated day of week

"EEEE" full weekday name

"D" date without leading zero

"DD" 2 digit date with leading zero

"DDD" short day of week text string

"DDDD" long day of week text string

"M" month with leading zero

"MM" 2 digit month with leading zero

"MMM" Short month text string

"MMMM" long month text string

"YY" year as decade

"YYYY" full year



As with JavaScirpt and FromCalc case is important.



More information about date formats is contained in the "Scripting Reference" under LiveCycle Designer's menu bar "Help" option.

Avatar

Level 1
Ok is there any way that you can get the DATE FIELD to only accept putting in the date or have the calendar in there, and not have any TEXT or LETTERS in there. I mean is there something I need to click on in Live Cycle to make this happen to where when you click on the date field you automatically get a calendar and can choose a date and cannot have an option to type any letters in? Anyone, please help.

Avatar

Level 7
Yes, but you need to set a lot of the optional formatting options for the field using the strings I posted above.



The format fields are CASE dependent!



The order of the date elements is important.

Avatar

Level 1
We've done that (MM/DD/YYYY). However we're still getting that we can type in letters in the date and time field and we don't want that. We specifically want only the date. So can you walk me through what I need to do?