Is it possible for eform to be set up to validate form elements that are injected into the DOM by javascript? I’m guessing I’d need to amend the form template chunk on the fly using an eform event, or a custom snippet that runs eform using $modx-runSnippet() ?
This is the kind fo thing I need to achieve:
<!--hardcoded markup-->
<input name="name1" id="name1" type="text" value="[+name1+]" eform="Name1::1:"/>
<!--injected markup-->
<input name="name2" id="name2" type="text" value="[+name2+]" eform="Name2::0:"/>
The injected markup would always be a copy of an existing section of hardcoded markup, but with an incrementing trailing index, eg name1, name2, name3.
Going on from the initial validation of this data, I also want to be able to store the data in a database and then retrieve it and repopulate the form. And I should also mention that this would be a multi-page form with a branching.
Is eform the best tool for this or should I write a custom class? If so, can anyone point me to a super flexible form handling library that works nicely with modx? If anyone has ever done anything like this I’d love to hear the details.
Thanks!
Mark