Using java to search for a data range
Hi,
I have a two text boxes, one is the users input for a serial number and the other text box checks what was writtin as a serial number and changes what is written in it depending on the range. the serial numbers are like this:
AHB15000 - AHB15999
BHB15000 - BHB15999
CHB15000 - CHB15000
as there is a serial number break at KHB15103 everything before should say one thing and everything after should say something else. Other than writing the following code im not sure what to do:
else if (/KHB15000/.test(s)) event.value = "option 2";
else if (/KHB15001/.test(s)) event.value = "option 2";
else if (/KHB15002/.test(s)) event.value = "option 2";
else if (/KHB15003/.test(s)) event.value = "option 2";
etc.
Sorry im quite new to this so dont have a huge amount of knowledge!
this is the code I am useing:
var s = this.getField("Serial No").valueAsString; // insert actual field name
if (/KHB15//.test(s)) event.value = "Option 1";
else if (/MHB15/.test(s)) event.value = "option 2";
else event.value = "TEST";
Thank you
