function init() { alert("Hello"); IWEventRegistry.addItemHandler("/RelatedLink/LinkType", "onItemChange", Redirect); Redirect("/RelatedLink");}function Redirect(MyItem){ MyItem = "/RelatedLink";alert "MyItem"; // I believe you need ()'s around your message, i.e. alert("MyItem");.setVisible(MyItem) // You are calling a function 'setVisible' that does not exist. // You don't need it, but you probably want a ; at the end of your line.}function setItemVisible(MyItem){ var repInst = IWDatacapture.getItem(MyItem);alert "repInst"; // I believe you need ()'s around your message, i.e. alert("repInst");. var children = repInst.getChildren(); var count = children.length; var i = 0;for(i=0 ; i var repInstance = children; // This is just completely wrong. var ltype = repInstance.getChildByName("LinkType"); var ltvalue = ltype.getOptions()[ltype.getValue()].value; var winName = repInstance.getChildByName("WindowName"); var winParam = repInstance.getChildByName("WindowParameters"); if (ltvalue == "New Window") { winName.setVisible(true); winParam.setVisible(false); IWDatacapture.redraw(); } else if (ltvalue == "Pop Window") { winName.setVisible(true); winParam.setVisible(true); IWDatacapture.redraw(); } else { winName.setVisible(false); winParam.setVisible(false); } }} // This doesn't seem to match up with an opening curly brace.IWEventRegistry.addFormHandler("onFormInit", init);