Highlighted

check if the rawvalue contains "TW"

swvermeulen

31-07-2008

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?

Replies

Highlighted

_SekharN_

31-07-2008

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

}

}