This is how things would be within the DCT:IWEventRegistry.addItemHandler("/news/title", "onItemChange", toUpperCase);var UpperCaseItem = IWDatacapture.getItem("/news/title");toUpperCase(UpperCaseItem);function toUpperCase(item) { item.setValue(item.getValue().toUpperCase());}
IWEventRegistry.addItemHandler("/news/title", "onItemChange", toUpperCase);var UpperCaseItem = IWDatacapture.getItem("/news/title");toUpperCase(UpperCaseItem);function toUpperCase(item) { item.setValue(item.getValue().toUpperCase());}
function init(){ ... IWEventRegistry.addItemHandler("/news/title", "onItemChange", toUpperCase); ...}function toUpperCase(item){ item.setValue(item.getValue().toUpperCase());}
Hi Ghoti,Thanks for the reply and you are right about the 2 extra lines not being needed. As for what I'm looking to do, let me try to explain it further.You mentioned that I could abstract it so that it doesn't matter what the field is. That's good and that what my plan is. My goal is though is to abstract it to a level where I can use it across forms. I'm not being specific to the toUpperCase command either here so it's not that what I'm stuck on.The goal is to run a script so that the following command can be used...IWEventRegistry.addItemHandler("/" + root_container_name + "/" + item_name, "onItemChange", toUpperCase);In this fashion, I can pass in the values of root_container_name and item_name into the function.Hopefully I've explained myself better - my apologies for not doing so at first.Thanks,/D