Expand my Community achievements bar.

Highlighting a drop down list field

Avatar

Former Community Member
Dear All,



How can I highlight a drop down field. Its not working if I use xfa.host.setFocus() function. The problem is , I am having three drop down list(array, with same name), I need to choose one element from each drop down list, but I cannot choose same item which was already selected in other lists, If I select same I need give a alert and need to highlight the field. How can I get the selected index of a drop down list, like we have some selectedIndex in html. Any help regarding this is appreciated.



Thanks,

Nagesh
3 Replies

Avatar

Former Community Member
There is an example in which similar to what you are looking for. I am not quite sure if this is exactly what you are looking for.



http://66.34.186.88/LiveCycleSamples/MultipleDropDownList/making3differentChoiceFromAList.pdf



In this example, user is required to choose 3 out of 4 available colors.

Avatar

Former Community Member
Dear Jimmy,



Thank you for your reply. But this is not exactly what I am looking for. My problem is I want select unique name from the available drop down lists. At the time of form loading I am populating the data into drop down lists, each drop down list will have the same values, for example red,blue,purple all these values will available in three drop down lists. If I select red in one drop down list and select same in red in another list I need to alert the user to select different color. Any help regarding this is appreciated.



Thanks,

Nagesh

Avatar

Former Community Member
On the 'change' event of the dropdownlist2, you can put something like this:



if ((xfa.event.newText) == DropDownList1.rawValue)

{

app.alert(xfa.event.newText + " has been selected.");

}



On the 3rd dropdownlist3, you can put something like this:



if ((xfa.event.newText == DropDownList1.rawValue) || (xfa.event.newText == DropDownList2.rawValue))

{

app.alert(xfa.event.newText + " has been selected.");

}