The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Default date value from another date in form
Is there a way to have the default value of a date field based on another date field in the form? I certainly can do it with a text field since options to copy from another field value is available. However, that goes away with a date field.
February 11, 2019 at 9:58 am
Date fields are driven by jQuery functions that execute in real-time in the browser. Default values are shortcodes that are executed on the server, either through Ajax calls or before the form is rendered in the browser.
If you want to default one date field based on the value in another, you have to do so with a custom jQuery. The jQuery function has to monitor the first date field for changes, then apply whatever date math you want to form the second field's value. Once your calculations are done, you apply that value to the second date field. (I'm assuming the date math part).
February 11, 2019 at 10:07 am
I was looking at the documentation here: https://formidableforms.com/knowledgebase/lookup/#kb-populate-fields-with-values-from-a-selected-entry
This is exactly what I wish to accomplish but it seems like some of those options have changed.
Simple, i have a form 1 with entries: A,B,C
In a separate form 2, have the dropdown referring to form 1 and entry A.
I would like field in form 2 to auto-populate with entries B & C based on the selection of A.
Having trouble making that happen. Seems simple from the doc but I don't see the options in the lookup field.
February 11, 2019 at 10:54 am
No, the options haven't changed. They are still there, even for date fields.
You first setup your lookup field. Then, each of the fields you want to populate will have a "Lookup value" checkbox in the "Dynamic Values" section. Once you click on that check box, the options open up to allow you select the fields from the lookup table and watch the lookup field for changes.
I just tested this in my dev environment and it's all working as described in the knowledge base article.
February 11, 2019 at 10:58 am
Yes. I realize that now and I've sorted it out. It works as I need it to.
Thank you for helping!
Discussion closed.