Skip to main content
Participating Frequently
Sep 12, 2025 5:00 AM UTC
Answered

get item index at listbox/combobox by its value/export value

what is the simplest way in general case ?

only use getItemAt()  for round checking ?

 

PDF Automation Station
Community Expert
Sep 12, 2025 10:38 AM UTC

function getIndx(f,item,type)
{
for(var i=0;i<this.getField(f).numItems;i++)
{

if(this.getField(f).getItemAt(i,type)==item)
{return i;break}
}
}

//Call by export value
getIndx("Dropdown1",3,true)
//Call by value
getIndx("Dropdown1","A",false)

2 replies

PDF Automation Station
Community Expert
Community Expert
Sep 12, 2025 10:38 AM UTC

function getIndx(f,item,type)
{
for(var i=0;i<this.getField(f).numItems;i++)
{

if(this.getField(f).getItemAt(i,type)==item)
{return i;break}
}
}

//Call by export value
getIndx("Dropdown1",3,true)
//Call by value
getIndx("Dropdown1","A",false)

Translate
try67
Community Expert
Community Expert
Sep 12, 2025 8:12 AM UTC

Use getItemAt in a loop, yes.

Translate