Lookup default value on checkbox / file upload / dropdown

By: Henning Jønsson | Asked: 05/03/2024
ForumsCategory: Code HelpLookup default value on checkbox / file upload / dropdown
Henning Jønsson asked 2 months ago
Hello

I'm totally new to formidable forms but trying to learn :)
I have a form where I want the ability to choose between a few standard fill forms.

The form contains e.g.

One Dropdown (with 5 standard fill forms - already fill forms)

One Checkbox 
One Text field 
One File upload. 
etc. 

If you choose one of the 5 standard forms, let say option 1. The rest of the questions on the form must be filled in automatically.
Like

checkbox - option 2
text field - xxxx xxxx
File upload - test.txt

If i choose option 2. 

checkbox - option 4
text field - YYY YYY
File upload - Morning.txt  

is that possible?
it is possible to use "Lookup default value" on text fields, but it is not supported on checkbox/file upload/dropdown.
1 Answers
Victor Font answered 2 months ago
What do you mean when you say you want to select one of five forms? A form is a collection of fields and fields have values.
Henning Jønsson replied 2 months ago

sorry for my bad english - will try to explain.

I have 2 formulas, with the same 10 fields.

Form 1 - called "standard answer"

form 2 - has an extra field. (dropdown) which is a "look up", that looks in form 1.

Let's say 5 responses have been made in form 1.

So when you click on the dropdown menu, there are 5 options.

If you choose one of these, all fields i formel 2, must be filled in automatically according to the formula you choose from formula1.

I can do it on a text field, since it supports the
"Lookup default value", where I can choose to look in the fields from formula 1.
But this option is not available on Checkbox / Dropdwon / File upload etc.

Does it make sense.?

Victor Font replied 2 months ago

What is the source of the data used to automatically fill in Form 2 when a dropdown value is selected. It sounds like you may have to use Ajax, but you provided enough details about how Form 2 is populated.

Henning Jønsson replied 2 months ago

I don't think I understand.?

The source is the answers to formula 1. (Formula 1 contain the same 10 fields as in Formula 2.).
These values ​​must now be copied to formula 2 when you select the answer from formula 1 in the dropdown menu.

I will try to read up on AJAX. Do you happen to have an example of some code that could be used.?

Victor Font replied 2 months ago

No I do not. In fact having two forms with the exact same fields goes against the "single source of truth" data management principal.

What doesn't make sense is why you have a drop down at all to select a value if you are copying the same values as form A. Nothing you've explained makes sense for a good design.

Henning Jønsson replied 1 month ago

The reason I have made 2 identical forms is that each customer can make a "the 5 most used answers".
The customer uses these forms for documentation, so the same answers are often the same.
Therefore, you have the option of making 5 most used, so that you don't have to fill in the same question every time. call it a quick access.

Victor Font replied 1 month ago

Good luck with solving your problem.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right