0

I want to check if a page item contains a substring ABC. I have tried

console.log($v("P2_ITEM1").indexOf("ABC"))

and it returns -1 even though the item does contain the substring ABC

What am I doing wrong? Is there a betetr way to do that?

Coding Duchess
  • 6,445
  • 20
  • 113
  • 209

1 Answers1

0

Apparently it's right. Are you sure that item contains the string "ABC", indexOf is case sensitive.

I try in this page: https://apex.oracle.com/pls/apex/f?p=145797:15:

This instruction and it's ok.

console.log($v("P15_SELECT").indexOf("lb"));
console.log($v("P15_SELECTED").indexOf("lb"));

Javascript contains case insensitive

romeuBraga
  • 2,135
  • 1
  • 8
  • 20