I have a page which enables someone to book a lesson for a group. The person booking needs to say how many people will be in the group and what their names/emails are. It could be one; it could be ten.
An alternate might be to just present the one form for one name/address, and each time the user submits the form, add that name and email to a temporary table. Each time the form is presented, you have an “add user” button to add the form contents to the list, and a “list complete” button which then submits all the names on your temporary list to the next stage of the booking.
I’d be happy to help, but my JS is almost non-existent - I can look at it, perhaps spot typos, and sometimes build bits of it up into something that works, but no more than that. Post in the JS section, though, and there are many helpful people in there who actually know what they’re talking about.
Since you should be selecting from existing (registered) students at the point of picking them for a specific group, the available students should already be stored in a database table. The User Interface (UI) for this operation should be selecting from existing students (either using a select/option menu, or check-boxes), probably matching some filter/search term, such as a grade level or those taking a class from a specific teacher, not typing in values, and the form would only submit the selected student ids (auto-increment primary index), not two different pieces of data for each student.
Hi @mike324, rather than adding multiple forms I’d suggest to just append fieldsets to the parent form, which would be easier to process – you’d just have to submit that single form. Such a fieldset can be defined as a template: