Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
8 subscribers
Views
3190 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I have 2 dropdowns at my form, If I select the option of the index 1 of dropdown
jmenezes
over 11 years ago
I have 2 dropdowns at my form, If I select the option of the index 1 of dropdown1, I want that dropdown2(that is read-only) also selects his index 1. How can I do it on Appian?...
OriginalPostID-56260
OriginalPostID-56260
Discussion posts and replies are publicly visible
0
Ravichandran Thiruganasambandham (Ravi Sam)
Certified Lead Developer
over 11 years ago
If dropdown 2 is going to be read-only always, a read-only textfield might be a better option instead. FormAPI.setValue() can be used to set the appropriate value in the read-only textfield.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Ravichandran Thiruganasambandham (Ravi Sam)
Certified Lead Developer
over 11 years ago
Elaborating on my respone above
You could get the appropriate index value from the dropdown1, based on the index you could set the exact value to the textfield using FormAPI.setValue().
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jmenezes
over 11 years ago
I'm talking about index, for example: I've the dropdown1 {apple, banana, pear} and the dropdown2 {red, yellow, green}. If I select "apple" on dropdown1, dropdown2 should show "red". If I select "banana" on 1, 2 should show "yellow". If I select "pear", should show "green"... you got it?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Ravichandran Thiruganasambandham (Ravi Sam)
Certified Lead Developer
over 11 years ago
My earlier posts are probably not clear. What you could do, is get the index of the selected item in your dropdown 1 using onchange event (your code for that will look something like - index = document.getElementById('dd_id').selectedIndex; Now, have an hidden field on your form with the values of the second dropdown. In your JS, you can get the value of this hidden field using FormAPI.getValue. Then, you could use the valueOf function to get the value at the corresponding index in the hidden field. This value can then be set as the value of your read-only text box (note: instead of using a read-only drop down, I am suggesting a text box).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sanjay
over 11 years ago
jmenezes, curious why a read-only dropdown is needed when users are not going to be able to drop it down. Is it just for the look and feel? I'm sure 'Advanced Form Utilities' under forum shared components has features to implement the dynamic dropdown that you're looking for.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jmenezes
over 11 years ago
Thank you Ravi, I got it now and it worked.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel