Hi All,
I am trying to use a custom JavaScript to duplicate information from one section to another repeating section in my classic Nintex Form. I have one text box input and choice option input that I want duplicated in the second repeating section of my form. See my variables below and the current JavaScript that I copied into my form. This JavaScript is also using a button to initiate the duplication. For some reason this script isn't working and I am not sure why. I think it may have to do with the button being used but I am not sure.
Repeating Section 1 = repeat1
1st input text box = assetamt
2nd input choice option = assetselection
Repeating Section 2 = repeat2
1st input text box = assetamt2
2nd input choice option = assetselection2
Button = UpdateRepeater
Button also has action set to Javascript and client click to UpdateRepeater()
Javascript:
function UpdateRepeater() {
NWF$(".repeat1 .nf-repeater-row:not('.nf-repeater-row-hidden')").each(function () {
var $row = NWF$(this);
var $input1Val = $row.find(".assetamt input").val();
var $input2Val = $row.find(".assetselection input").val();
UpdateRepeater2($input1Val, $input2Val);
});
NWF$(".repeat2 .nf-repeater-row:last").find('.nf-repeater-deleterow-image').click();
}
function UpdateRepeater2($input1Val, $input2Val) {
NWF$(".repeat2 .nf-repeater-row:last").each(function () {
var $row = NWF$(this);
$row.find(".assetamt2 input").val($input1Val);
$row.find(".assetamt2 input").focus();
$row.find(".assetselection2 input").val($input2Val);
$row.find(".assetselection2 input").focus();
NWF$(".repeat2").find('a').focus();
});
NWF$(".repeat2").find('a').click();
}