match a field to a list of values

Avatar

Avatar

tarad4225910

Avatar

tarad4225910

tarad4225910

14-01-2021

Hi, I need to to display a field only if the Supplier number matching on in a list of values

 

 

some like 

 

if(FormPurchaseOrderRequest.frmShipAndBill.frmInfoBlock.txtSupplierID matches on of these values ('Y78DC','4568','PEN_V7','PNX_45','DC567'))
   then
       this.presence = "visible";
   else
       this.presence = "hidden";
   endif

list LiveCycle Designer

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

radzmar

MVP

Avatar

radzmar

MVP

radzmar
MVP

14-01-2021

Hi,

 

the best way it to check the input against an array of value.

var aList = ['Y78DC','4568','PEN_V7','PNX_45','DC567'],
    cInput = txtSupplierID.rawVaue, 
    bMatch = aList.some(function (cValue) {return cValue == cInput;});
this.presence = bMatch ? "visible" : "hidden";