on 11-08-2017 5:00 AM
Hi experts
I am trying to display the values of a multiselect list box in a text box. I have tried using the below script to achieve this and it is not working and I don't know what I am doing wrong.
if(SALES_TYPE_SELECT.getSelectedValues()=="Value1;value4"){
TEXT_4.setText("Daily Sales for EMEA");
}
if(SALES_TYPE_SELECT.getSelectedValues()=="Value2;value5"){
TEXT_4.setText("Daily Sales for APCA");
}
if(SALES_TYPE_SELECT.getSelectedValues()=="Value3"){
TEXT_4.setText("Daily Sales for Other");
}
Hi Robert,
Your code does not work because getSelectedValues() returns an array of strings and not a concatenated string. The following code should achieve the desired result:
var selectedSalesTypes = me.getSelectedValues();
var salesTypeString = "";
selectedSalesTypes.forEach(function(salesType, index) {
salesTypeString = salesTypeString + salesType;
});
if (salesTypeString == "Value1Value4") {
TEXT_4.setText("Daily Sales for EMEA");
} else if (salesTypeString == "Value2Value5") {
TEXT_4.setText("Daily Sales for APCA");
} else if (salesTypeString == "Value3") {
TEXT_4.setText("Daily Sales for Other");
}
Regards,
Mustafa.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the support. It worked effortlessly
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.