Forum Discussion
irina_lukina
15 years agoSuper Contributor
Hi Michael,
Amit is right. The code below returns the correct value of the State for withholding field.
function getOpenState() {
lMatchStr = 'Page("http://www.paycheckcity.com/calculator/netpay/us/';
lMatchLen = lMatchStr.length;
lIE = Sys.Process("IEXPLORE", 2);
Sys.Refresh();
lCount = lIE.ChildCount;
for (var i = 0; i < lCount; i++) { // Look at all the children until we find the one that has the webpage we want
lName = lIE.Child(i).Name;
//Log.Message(lName);
if (lName.substr(0, lMatchLen) == lMatchStr) { // found the IE page
lRet = lName.substr(lMatchLen, lName.length - lMatchLen); // get everything past lMatchStr for further processing
return lRet.substr(0, lRet.indexOf("/", 0)); // return everything before the /
}
}
}
Did you try using it?