Buy Now
Sign in

Dynamic data text key

studio16 , October 12 at 12:26
s
studio16

Hi

I use a db read on load to fill a dropdown if a from field has a zip code
I added a dropdown to the form with dynamic data enabled.
Is it possible to use multiple db fields as text key in that dropdown?
For example i populate from db via a db read id, zipcode and city.
I need in the dropdown <option value="id">zipcode - city</option>.

I also use an ajax event (Designer tab) (another db read + custom code) to fill the dropdown while typing.
The ajax event works great and i can manage the options via
$options[$d['id']] = $d['zipcode']." - ".$d['city'];

Can that be done also for the onload db read?


Using V5 by the way

GreyHead

Hi studio16,

You should be ale to use Custom code either to add a custom query that concatenates the column values' or after the DB read to do the same after the data is read.

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

N
NJM

Hi there,

Thanks for the info. I have the same question.
How do you obtain the values, to concatenate them?

I mean :
When you load the DB via DB read and the ModelID is "user" -> which contains 'name' and 'firstname'.
How do I approach those values then?

Something like user[name] ?

Thanks!

GreyHead

Hi NJM,

Please see this FAQ. To see exactly wht data you have after the DB Read you can add a Debugger action temporarily.

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much