StratusForms icon indicating copy to clipboard operation
StratusForms copied to clipboard

Repeating Inputs

Open joshuanava opened this issue 6 years ago • 4 comments

Trouble loading value of repeating inputs. Data saves to list. Rows load but only first row has data. I used span and it works. But it loads the previous value on Add Row call.

Gains
Add Gain
n/a

joshuanava avatar Apr 18 '18 18:04 joshuanava

Can I see your HTML?

mrackley avatar Apr 26 '18 17:04 mrackley

Hi I had multiple tables that were repeating so when the form populates all the Input Fields in the JSON array keep incrementing? I reset repeatNum to 0 haven't tested it fully. It saves fine though I use the JSON in another page for reporting.

if (field === "StratusFormsRepeatable") { var repeatableArray = formData[field]; var repeatNum = 0; for (var index in repeatableArray) { if(repeatableArray[index].ID==='GainRow') repeatNum=0; if(repeatableArray[index].ID==='LossRow') repeatNum=0; if (repeatableArray[index].StratusFormsParent != "undefined") { $().StratusFormsRepeat(repeatableArray[index].StratusFormsParent); } var thisRepeatableForm = $(form).find("#" + repeatableArray[index].ID); PopulateFormData(thisRepeatableForm, repeatableArray[index],{},repeatNum); repeatNum++; // This # keeps incrementing if you have multiple tables with inputs , 11, 12 etc.. } }

joshuanava avatar Jul 02 '18 22:07 joshuanava

Version 1.55 (in beta) has some fixes around repeating rows, I wonder what your experience would be if you tried it?

mrackley avatar Jul 03 '18 12:07 mrackley

Definitely can test it out, this is a great library btw solves alot of problems. Used other commercial apps but they like to log back to home since it subscription based. Thanks for all the work you put in

joshuanava avatar Jul 04 '18 18:07 joshuanava