Count items in a Drop-down list

D

drummiezoe

I have a dropdown list that is populated based on a user selection
(Customer/Location relationship). When the user selects a Customer, the
second drop down shows available locations of that particular customer.
There are times in which there may only be one location for a customer.

How can I set up my form so that the Location drop down list will recognize
if it only has one value and automatically select that value?

Thanks,
~Zoe
 
S

Swathi (GGK Tech)

Hi,
If you are using an external data source for displaying the values in drop
down. If so that must be a repeating node. So get the count of that repeating
node which is same as the number in first drop down. Add a filter on the
customer and get the count of the second drop down. So that you will get the
number of value sin second drop down.
 
E

Ed Thurber

You can use a rule to set the value of the Location dropdown to
location[@customer = my:customer]. This will set it to the first location
in the list.

Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top