You are viewing limited content. For full access, please sign in.

Question

Question

Date Field - Year defaults to 0000 when manually entering date

asked on January 27, 2016 Show version history

I am using Forms 9.2 and am experiencing a slight issue with a Date field.  When I click on the date field within my form, the calendar opens automatically for me to select a date.  If I try to type a date into the field manually, the year automatically defaults to 0000 and does not allow me to change it.  This issue does not occur when I use the calendar that opens.  Is there anything that can be done to stop this from hapenning?

LF-year.JPG
LF-year.JPG (19.89 KB)
0 0

Replies

replied on January 27, 2016

Did you check the console for any errors or warnings? It could be that date you are trying to enter is not valid. I see in the image that you are entering 31st, which calendar couldn't find, maybe thats why its defaulting to 0000. Try different dates and see how it reacts.

0 0
replied on January 27, 2016

Junaid,

Yes, it still occurs when I attempt another date.  For instance, I start to type 02/ and then it jumps to 02/01/0000.  I did not find anything on the console.

0 0
replied on January 27, 2016

Hi Travis,

What's the exact version of Forms you're using? Please check the "About" dialog in Forms for this. Also, besides the field being required, are there any other details about the date field to be aware of? Do you have any custom JS involving that field, etc.?

Regards

0 0
replied on January 28, 2016

We are using Forms 9.2.1.1069.  We do not have any JS running for that field.  However, we do have a Lookup Rule that automatically enters 12/31/2100 into this date field when a certain word is selected in a dropdown field in the form.  When that word is not selected, the user is able to enter whatever date they wish.  That is when this issue occurs.

0 0
replied on January 28, 2016

I see now. Its Field Look up rules. Possibly you may have same date field mentioned multiple times in a field rules, that messes up everything. Try disabling, field rules and see if you still get the error. If not, then i would prefer to use JS than Field rules. Just personal preference. 

0 0
replied on January 28, 2016

Travis,

In your external data source where you run the lookup from, are the other values in the drop down field mapped to a "blank" date value, or 1/1/1900 in SQL?

I was able to recreate the issue when using the above scenario. Also, in Forms 10, while the issue is still somewhat present, you do have the ability type out a new date value and it won't be forced to use the year 0000.

If you set those dates in your data source to NULL, then there's no issue. You can also bypass the lookup and use javascript as Junaid had suggested since it seems you only really want the date to be set to a certain value based on a specific drop down selection while any other drop down value won't impact the date.

We'll look into this behavior though and see if it can be handled cleaner.

0 0
replied on February 18, 2016

I have had this problem numerous times as well.  I was told that it is because in the field set up I chose a format that needed the 4 digit year but the user was only entering a two digit year (i.e. 00 instead of 2000 or 15 instead of 2015).

0 0
replied on February 19, 2016

I sent the issue to our VAR and had them take a look at the SQL table on seeing if the change of 01/01/1900 to "blank" would work and it did not.  So what he did was, he created another date field and hid it on the form.  He then created code for JavaScript to pass the value of the hidden field back to the date field that we were having trouble with.  It seems to be taking care of the problem.

0 0
replied on February 19, 2016

SQL will set blank date values as 1/1/1900. If you set it to NULL, then that should bypass the issue.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.