I use eForm Designer Version 22.214.171.124, 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.
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 Posts
Re: How to set "Optional Descriptive text" to ChoiceList items dynamically2011-06-27T12:45:34ZThis is the accepted answer. This is the accepted answer.I 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(";");