I use eForm Designer Version 126.96.36.199, P8 CE 5.0, WAS 7.0.
The following example creates a new choice list named ColorList with three values: orange, purple, and green.
form.createChoiceList("ColorList", new Array("orange", "purple", "green");
How can I add to choices the optional descriptive text ?
I need to show the "Optional Descriptive text" to user and the "Choice value" send to futher processing.
This topic has been locked.
1 reply Latest Post - 2011-06-27T12:45:34Z by miro_novotny
Pinned topic How to set "Optional Descriptive text" to ChoiceList items dynamically
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2011-06-27T12:45:34Z at 2011-06-27T12:45:34Z by miro_novotny
miro_novotny 060001JBKY3 PostsACCEPTED ANSWER
Re: How to set "Optional Descriptive text" to ChoiceList items dynamically2011-06-27T12:45:34Z in response to miro_novotnyI already found the solution, it's easy:
Every item should contain 2 values (description,value) separated by 2 pipes, "Desc1||Value1".
So the sample for choicelist with 3 items is as folows:
var varVal = new Value("Orange item||orange;Purple item||purple;Green item||green;");
function fillChoiceList(values, chlName)
var myChoiceList = form.getChoiceList(chlName);
if( myChoiceList==null) throw "ChoiceList" + chlName + " not exist.";
var choiceArray = values.asString().toString().split(";");