Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
FormAPI Replicant Problem
Karen
Hi,
I am having a problem with registering replicants using FormAPI. I have a replicant field containing many items. The user selects an option from a list and the relevant fields become visible. My problem is that this only works for the first replicant. When a subsequent replicant is added, all the fields are displayed to the user.
I have tried using the following script which I found on this forum but I can't seem to register the replicant field on an 'onItemChange' handler.
Can anybody please help?
var FormField = new Array();
var FormFieldItem = IWDatacapture.getItem("/test/formfields");
FormField = FormFieldItem.getChildren();
//loop through the children
for (j=0;j<FormField.length;j++)
{
var childItem = FormField;
var itemName = childItem.getName(); //Returns the XPath of the item as a string
}
function init() {
IWEventRegistry.addItemHandler(itemName,
"onItemChange", windowFields);
windowFields(IWDatacapture.getItem(itemName));
}
function windowFields(item) {
IWDatacapture.getItem("/total_reps").setValue(itemName);
setItemStatus (IWDatacapture.getItem(itemName + "/Text Box Field"), false);
IWDatacapture.redraw();
}
Find more posts tagged with
Comments
There are no comments yet