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
BedrockMission!

Learn more

View all

Sign in to view all badges

check if the rawvalue contains "TW"

swvermeulen
Level 2
Level 2
I have a Dropdown list called A with the following possibilities:

G

GTW

GLTW

SC

SCTW

E

ETW

and so maybe 30 more options



is it possible to check (with javascript) if the rawvalue contains "TW" because then I have to hide some subforms and show one other subform.



Can someone please help me?
1 Reply
_SekharN_
Level 5
Level 5
try the following in Change event of the Dropdown



var curSelection = xfa.event.change;



if (Right(curSelection, 2) == "TW") {

//use your code to hide and visibility

}



function Right(str, n){

if (n <= 0)

return "";

else if (n > String(str).length)

return str;

else {

var iLen = String(str).length;

return String(str).substring(iLen, iLen - n);

}

}