I created a function to be called to update a total amount:
It gets all inputs with a specific class, and performs the calc, and then sets a value in the dmx world.
function findTotal() {
var arr = document.getElementsByClassName('quote_detail_amount');
var tot = 0;
for (var i = 0; i < arr.length; i++) {
if (parseFloat(arr[i].value))
tot += parseFloat(arr[i].value);
}
dmx.parse("content.quote_total_amount.setValue(" + tot + ")");
}
The following is the input inside the repat, that I want to use in the function calc, so I add a class to it and add the onupdated attribute:
For anyone using @mebeingken's code to run the sum total script, I suggest you think about running the script from a page flow, so you can add debounce (if desired).
Was just about to post to ask if accessing form repeat data was possible… Will this be implemented soon? Otherwise I’ll have to do what I wanted with a normal repeat / table
Can I also add to this request that nested form repeats become a thing. When the input names are being generated, it only generates from the current repeat and not from the parent. (I’ve tried to override this with binding a custom name, but this does not work) E.g.
– ParentRepeat[0][ChildRepeat][input]
Use case is for creating a family file. Creating multiple parents with multiple phone numbers and email addresses each.