After form.errors, loop through form.vars. If you find a var with a name that matches one of your added fields, use a TR() call to construct a table row for your added field. It should probably look something like TR(TD(LABEL(nameofyourcustomfield)), TD(valuesubmittedontheform))
Then do a form[].insert(). The how-tos are all covered in the book. Check out "HTML Helpers" in Chapter 5 and "Adding extra form elements to SQLFORM" in Chapter 7. On Sep 29, 12:50 pm, Joseph Jude <ceph...@gmail.com> wrote: > Hi all, > With help of members of this group, I was able to produce a dynamic form > where text fields can be added / removed at the client side. However, I got > one (hopefully the last) problem. > > This form contains two sets of fields - in the first set, there is only name > which is mandatory; in the second set, at first 3 fields are shown, but > users can add / remove as they like. > > The issue happens when a user adds two more text field (in the 2nd set) and > then submits a form with empty name. The form.errors kick in and then the > original form is displayed again (loosing all data data in the dynamically > added fields). > > How do I handle this? > Thanks in advance, > Joseph