Buy Now
Sign in

refer to a dropdown value to pass as parameter to event

gix.vax , March 05 2020, 16:13
gix.vax 119
March 05 2020, 16:13 #391515
Hi all
i have dropdown well populated that feed a field in a table
name of dropdown: priority_accepted1
v:Very High

it works ok and save the keys n, v or h in database

now i need to save in a field of another table, a text composed by the value (not the key) and something else

in an avent (Change_priority) i put
{fn:save_evento_chat$descrizione_evento=Priority changed to (data:priority_accepted1) (n-Normal h-High v-Veryhigh)}
if for example i choose VeryHigh it store
Priority changed to v (n-Normal h-High v-Veryhigh)

it works ok
but for a better visualization i would like to store something like
Priority changed to Normal
Priority changed to High
Priority changed to Very High

i tried
{fn:save_evento_chat$descrizione_evento=Priority changed to (data:priority_accepted1.value) }
but it doesn't work

is there a way to take the value from dropdown and not the key?
thank you
gix.vax 119
March 05 2020, 22:27 #391522
i solved in this way
created a custom code in php that populate a data value {data:priority_data} and call it before the function with parameters
if you need it is this
if ($priority=='n'){
if ($priority=='h'){
if ($priority=='v'){
$this->set("priority_data","Very High");
now, for a dropdown populated from table i need the same but i think i have to read again from table filtering value from dropdown
the start answer remain, changing a bit:
Is there a way to store the value of dropdown before the form is sent?
Not the key, the value.
healyhatman 9
March 06 2020, 02:58 #391525
You mean the LABEL. The "value" IS the key.
And no, not without javascript.
Web developer at - I DO NOT work for ChronoEngine!
Professional Work:
Custom CF / CC Plugins and Extensions:
gix.vax 119
March 07 2020, 16:44 #391560
yes i mean label
for now i mark as solved
if someone have a javascript already written, post it please.