What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    DateTime: don't allow two digits in the YEAR input to be submitted

    Asked by Alpine365 on June 05, 2015 at 09:55 AM

    OK, the problem is this - I have several date fields on my form, formatted EU dates (dd/mm/yyyy)

    The problem is, if users enter the year as two digits (eg 71, not 1971) the data is accepted/submitted, but then, when it is exported through Excel, it loses the date and becomes a large negative number eg -667726 (I assume this is 667726 days before a certain date (today?) meaning it treats the date 71 as AD0071? But as Excel does not have an date functionality before 01/01/1900 you cannot use this info to work back the correct date!

    I have tried several fixes without success:

    - changing the "limit dates" property (has no effect, users can enter any date they want. even if they use a 4 digit date)
    - adding conditions for the date field - these worked to stop incorrect dates outside of the condition, but DIDN'T work for years entered as 2 digits!


    - (edit - see below, this now works) setting up a text box with an input mask of ##/##/#### and clicking 'Fill Mask' - for some reason this does not work on my form, users do NOT need to enter 4 digits. BUT when I tried this on a test from it worked fine! - see "Test Date Mask" on the linked form

    Can anyone help?

    FYI I have just cleared my cache, and now the text box mask works, so that is something, but this is not actually a date, so I need to do some reformatting in Excel. And still can't find a way to get the date fields to not accept two digit years

     

    Page URL:
    http://www.jotformeu.com/Alpine365/BookingForm?wq79ttx=4fp9ol&amp;wf01<br/>kk=Chalet%20Pisteside&amp;f21ei5[day]=16&amp;f21ei5[month]=1&amp;f21ei<br/>5[year]=2016&amp;ghfd27[day]=2

    date field problem digits datetime year input
  • Profile Image
    JotForm Support

    Answered by Welvin on June 05, 2015 at 02:03 PM

    Our apologies for the problem. I have tested this and was able to replicate the problem. Indeed, the result is causing a problem in the excel file.

    I have now submitted this thread to our developers, requesting not to allow two digits in the year input for the Datetime field.

    For now, you may consider using the following date widgets:

    http://widgets.jotform.com/widget/birthdate

    http://widgets.jotform.com/widget/date_picker

    http://widgets.jotform.com/widget/mini_date_picker

    http://widgets.jotform.com/widget/large_date_picker

    Thank you for reporting.