Assigning numerical values to select lists

David Bowen shared this question 4 years ago
Answered

I am trying to present an error message based on selections within two separate select lists. The first list has values like 25/50/25 and 50/100/50, while the second list has values like 25/50 and 50/100. The way it needs to work is that the second value can't be higher than the first two numbers on the first value. So, the person should see an error if they select 50/100 if the first value was 25/50/25, etc.


I thought I might be able to assign numerical values to each value behind the scenes, so I could use a comparator. The only other option is to use if a=25/50/25 and b=50/100, 100/100, etc., then display error. Unfortunately, I haven't been able to get that to work (and my first suggestion seems a lot easier).


How can I make this work?

Comments (2)

photo
1

You can check the real condition instead using the substring function:


http://www.justinmind.com/support/for...

photo
1

I don't want to format these numbers for display. I want to look at select list one choice and compare it to the selection in select list two. if one is bigger than the other, I want to display an error message (presumably within a dynamic panel. The combined numbers shouldn't appear to the user (the comparison is made in the background). Can this be done?