How to allow users to specify only month and year, without specifying the day?

  • MRtest_lih
    Demandé le 9 août 2023 à 07:58

    Bonjour,

    j'ai plusieurs questions avec une date a sélectionner. Je ne souhaite collecter que le mois et l'année, le jour n'étant pas pertinent.

    Comment puis-je avoir le format MM/AAAA et pas DD/MM/AAAA?

    Merci d'avance

    Jotform Thread 5412217 Screenshot
  • Marco Jotform Support
    Répondu le 9 août 2023 à 14:06

    Hi Maurane,

    Thanks for reaching out to Jotform Support. Unfortunately, our French Support agents are busy helping other Jotform users at the moment. I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in French, let us know and we can have them do that. But, keep in mind that you'd have to wait until they're available again.

    Now, let me help you with your question. To get only the month and year, you'll have to use a specific widget, the DatePicker Year Month.

    Give it a try and let us know if you need any other help.

  • MRtest_lih
    Répondu le 10 août 2023 à 04:42

    Many thanks.

    Is there any option for customization? e.g. min date and max date, translations (the form is available in En, FR, DE, PT)?

  • MRtest_lih
    Répondu le 10 août 2023 à 04:43

    Also I would like to change the colour (from gray to #293E84)

  • Marco Jotform Support
    Répondu le 11 août 2023 à 10:51

    Hi Maurane,

    Unfortunately the widget doesn't allow you to set a min/max date, nor to translate it in different languages.

    An alternative, more flexible for your needs, may be to add two dropdown menu fields: one for the months, and one for the years, like shown below:

    How to allow users to specify only month and year, without specifying the day? Image 1 Screenshot 60

    I'd suggest you to proceed in this way:

    1. Add a Dropdown field from the Form Elements list on the left side of the Form Builder.
    2. Once added to the form, click on it and click on the Gear icon to access the field settings.
    3. From the Dropdown Properties panel that appears on the right, click on the Options tab.
    4. From the Options textbox, specify the list of the months, one per line.

    How to allow users to specify only month and year, without specifying the day? Image 2 Screenshot 71

    Now, you need to create one more Dropdown field for the years.

    1. Add a Dropdown field from the Form Elements list on the left side of the Form Builder.
    2. Once added to the form, click on it and click on the Gear icon to access the field settings.
    3. From the Dropdown Properties panel that appears on the right, click on the Options tab.
    4. From the Predefined Options menu, select Last 100 Years, to get a list of the years automatically generated.

    How to allow users to specify only month and year, without specifying the day? Image 3 Screenshot 82

    Now, after you added the desired languages to your form, you just need to make sure that the list of months will be shown in the correct language, according to the form's language. So you need to translate the months in Spanish. Let me show you how:

    1. From the Form Builder, click on the Settings tab on the orange bar at the top.
    2. You'll see the Form Settings page. Scroll down until you see Translations, and click on the Edit button on the right.
    3. You'll see the additional languages you applied to your form. Hover your mouse over the language element and click on the pencil icon.
    4. Add the translation for each month, and that's it.

    How to allow users to specify only month and year, without specifying the day? Image 4 Screenshot 93

    Your form will work in this way:

    How to allow users to specify only month and year, without specifying the day? Image 5 Screenshot 104

    You can clone and test my simple demo form, if you'd like to inspect it deeper.

    Let us know if this solution may work for your.