Can anyone help with this?
I am using clonenode to create a same as function within my form. Once a user has gathered lots of information and then wishes to start a new record but using previous detail as a starting point,a same as function is used calling the clone function.
The code for performing the clone does work but it is not working for repeating groups within the parent. For example:
myFields/FirstGroup/FirstRepeatingGroup contains a group /SecondGroup/SecondRepeatingGroup - if rows exist in the SecondRepeatingGroup they do not get cloned - only the first blank row exists.
The clonenode is using (true) to set the deep parameter but does not seem to clone the repeating group.
The code goes like this:
var nodeList = XDocument.DOM.selectNodes("my:myFields/my:FirstGroup/my:FirstRepeatingGroup");
for ( var i = 0; i < nodeList.length; i++)
{
var RowIDfield = nodeList.item(i).selectSingleNode("my:RowID");
//Check if ID matches the Same As selection
if ( RowIDfield.nodeTypedValue == tempNode.text )
{
var oldRow = nodeList.item(i).selectSingleNode("//my:FirstGroup/my:FirstRepeatingGroup");
var newRow = oldRow.cloneNode(true);
}
Regards Spudy