Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

match a field to a list of values

Avatar

Level 1

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

1 Reply

Avatar

Level 10

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";