Skip to main content
Participating Frequently
September 12, 2025
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
September 12, 2025

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
September 12, 2025

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
September 12, 2025

Use getItemAt in a loop, yes.

Translate