Load form based on dropdown selection

jpurlings 22 Nov, 2016
Bob,

Sorry to ask your help again...😶

I added a dynamic dropdown to my form. I would like to fill the fields in the form based on a selection in the dropdown box. The lines in the dropdown correspond to a row in a table. Based on cf_id belonging to the line in the dropdown, the form should reload with the right values in all the fields. I tried several thing, searched the forums, but can't make it happen. Could you help me once more?

Greetings.
GreyHead 22 Nov, 2016
Answer
Hi jpurlings,

There are two main ways to do this:

a. The simplest, is to use a two page form. The first page has the drop-down and the second page uses a DB Read to look up the matching data and show it in the form.

b. You can use JavaScript to make an Ajax call back to the server when the drop-down changes, the call looks up the data and returns it to the browser where you can unpack it and set the input values from it.

Bob
jpurlings 23 Nov, 2016
Bob

Great! The solution with the two page form worked for me.

I bought you some coffee to thank you for all the help up until now!

Greetings.
GreyHead 23 Nov, 2016
Hi jpurlings,

Thank you, much appreciated :-)

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger