Filling fields with data from the DB
-
I’d like to set up a page where a user can select a choice from a dropdown built from entries in a DB and have that selection populate fields later in the form. I got the first part figured out from your “Create a Form Drop-Down with values from CFDB submissions” page, thanks!
The next part is using that data to fill out other fields. I’ve seen the dynamic text plugins, but they all seem to fail in not being able to put a shortcode within a shortcode.
For example, on page 1 of the form, the user selects a product from a dropdown. The value is the product ID. The user clicks Next and on page 2 of the form, I’d like to use that ID to pull data like price, description, etc from the DB using cfdb-value and fill in fields. If I could do this all on one page, that would be great, but it looks like most of these plugins are dynamic on page load, so I’m using a CF7 multipage plugin too.
I can get the value of the field from the previous page with the [multiform product-id] shortcode. But to use that to get another value like product name from cfdb-value, I have to put the shortcode within the shortcode. Like this:
[cfdb-value form=”Product List” show=”product-name” filter=”ID=[multiform product-id]”]
This obviously doesn’t work. What I would love is for a user to select an item from a drop down and then have it populate name, description, price fields on the form automatically. I think I’d have to give up on CFDB and use JSON/jQuery for that, though.
Thanks for your help!
- The topic ‘Filling fields with data from the DB’ is closed to new replies.