Dropdown trigger display field action

indyjoel

New Member
Hi have a database with two values in a row,
e.g. Label1, Value 1
Label2, Value 2

When I choose Label 1 via a dropdown box I would like another field to show Value 1. If I choose Label 2 I would like the field to show Value 2 etc


Is there a change event on the dropdown box that I can use with some SQL to do this

Many Thanks
 
What you describe can be done with a calc element or with an ajax routine but it's unusual to store the label and value in a form. Normally you would use a databasejoin element which just shows the label but stores the value in the backend.

Maybe you could explain a little more of what you are trying to achieve maybe we an example so we can point you in the right direction.
 
HI thanks. Will try to better explain
I have a form for data entry which has a dropdown called "Returned Reason"
DB.png

Depending on what is chosen in this combox I want to populated the "ht" field with a value of "H" or "T".
5JBLrRAAAAABJRU5ErkJggg==

The database table is setup as
fabrik.jpg

wMG0f1ljZO+BAAAAABJRU5ErkJggg==
 
You could do that with a fairly simple JavaScript event on the join element, running on 'change', which does:

Code:
form_X.formElements.get('yourtable___other_element').update(form_X.formElements.get('yourtable___dropdownjoin').getValue());

Replace X with the numeric ID of your form, which is the number in the leftmost column on your main display of Forms on the backend. Replace the yourtable___whatever names with your actual full element names.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top