• Resolved TheBusinessCat

    (@thebusinesscat)


    Hi there,

    I only need the year to appear in the date field and would like the day and month removed. Can this be done?

    Otherwise can I use a select field that would dynamically update the year every year without me having to go in and add the new year each year?

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @thebusinesscat

    I hope you’re well today and thank you for your question!

    Currently it’s not possible to hide day/month out of calendar out of the box and select field can’t be updated dynamically like this either.

    I suppose we could possibly use some sort of a custom code to achieve that but the date field still requires actual full date to be set.

    So let me ask first:

    1. the date field format that you are using – is it a calendar field or “drop downs”?

    2. can the day/month be set to some “specific” date or should it just be “today”?

    3. if it is calendar – is it fine to keep calendar visible but just “non-clickable” or should it be hidden?

    Kind regards,
    Adam

    Thread Starter TheBusinessCat

    (@thebusinesscat)

    Hi Adam,

    Thanks very much for your response.

    Below, please find the answers to your questions above:

    1. I am using the datepicker as a dropdown field.
    2. This form is used to list and sell a vehicle, so the user needs to just insert the model year, and that’s why I want to hide the date and month, as this does not apply to selling a vehicle.
    3. As per point one above I am using the dropdown option.

    Thank you.

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @thebusinesscat

    Thank you for response!

    In this case you can simply hide those year and day drop-downs with a bit of additional CSS.

    First, make sure that the datepicker field has an option set to set default date (e.g. to “today”) so it could be submitted even if client doesn’t select day and then

    – go to form’s “Appearance” settings
    – enable custom CSS option
    – and add this CSS there

    #date-1-day,
    #date-1-month {
      display:none;
    }

    Note: if your date field has different ID you’ll need to adjust it; for example, if it’s date-3, CSS would be like this

    #date-3-day,
    #date-3-month {
      display:none;
    }

    From now on both year and day will not be visible and clients will only have to select year.

    The downside is that you’ll still have full date in the submission on the “Forminator -> Submissions” page. But in e-email notifications you can only include year if you prefer if you use tag like {date-1-year}

    Alternative way is to simply use a standard select field with pre-defined list of years or use a number field with limits set to the numbers within some range.

    Kind regards,
    Adam

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @thebusinesscat,

    As it’s been a while since we last heard from you, I’ll mark this thread as resolved. If you have any more questions or need further assistance, don’t hesitate to reach out to us anytime!

    Kind Regards,
    Nebu John

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove Fields from Date Field’ is closed to new replies.