Hi all,
I ve created a form in which there are two drop down lists.
Let's one drop down list contains three items A,B,C
and another drop down contains three items Apple,Banana and Cherry.
So,my query is how to create a relation between these two dropdown lists,so that if I will select 'A' from the 1st drop down list, Apple will be selected automatically from the 2nd drop down list.
Thanks,
Debadas
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Debadas,
Niall's solution is great. You can also use a hidden field to update the second dropdown list value.
Script for the change event of first dropdown.
var select = xfa.event.change;
var Items = List1.resolveNode("#items[0]").nodes;
for (var i = 0;i<Items.length;i++) // This can be used to track the index.
{
if(select == Items.item(i).value)
{
break;
}
}
if(List1.length > 1)
{
var Items_List2 = SecondDropdownlist.resolveNode("#items[0]").nodes;
HiddenTextField.rawValue = Items_List2.item(i).value;
SecondDropdownlist.rawValue = HiddenTextField.rawValue;
}
Thanks,
Bibhu.
Views
Replies
Total Likes
Hi Debadas,
There is an example here, using the display and bound values of the dropdowns: http://assure.ly/fYCuQ2.
Hope that helps,
Niall
Hi Debadas,
Niall's solution is great. You can also use a hidden field to update the second dropdown list value.
Script for the change event of first dropdown.
var select = xfa.event.change;
var Items = List1.resolveNode("#items[0]").nodes;
for (var i = 0;i<Items.length;i++) // This can be used to track the index.
{
if(select == Items.item(i).value)
{
break;
}
}
if(List1.length > 1)
{
var Items_List2 = SecondDropdownlist.resolveNode("#items[0]").nodes;
HiddenTextField.rawValue = Items_List2.item(i).value;
SecondDropdownlist.rawValue = HiddenTextField.rawValue;
}
Thanks,
Bibhu.
Views
Replies
Total Likes
Thanks for your helpful answar..
Debadas
Views
Replies
Total Likes
Thanks for your useful reply...
Debadas
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies