StratusForms
StratusForms copied to clipboard
Repeating Inputs
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 |
Can I see your HTML?
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.. } }
Version 1.55 (in beta) has some fixes around repeating rows, I wonder what your experience would be if you tried it?
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