My current perl script gbook.pl allows the user to append one gbF() per submit.
This page and perl script: gbook_multi.pl appends more than one gbF() per submit. It is not possible to send an array of objects to the perl script. The perl script only gets name=value pairs. Therefore to send an array of objects, you need to structure the name to have a prefix and name. In this case, the prefix is the array_index so the page form has to have fieldnames where the input fields are named prefix_name.
gbook_multi.pl addes a separate entry for each sub form. The fields for each sub form must be named
prefixN_userfield1,prefixN_userfield2,prefixN_userfield3,prefixN_userfield4,prefixN_comments
p1_userfield1,p1_userfield2,p1_userfield3,p1_userfield4,p1_comments
p2_userfield1,p2_userfield2,p2_userfield3,p2_userfield4,p2_comments
p3_userfield1,p3_userfield2,p3_userfield3,p3_userfield4,p3_comments
..
p50_userfield1,p50_userfield2,p50_userfield3,p50_userfield4,p50_comments
gbook_multi.pl stores all the name=value pairs in an associative array. It also stores the prefixes in an associative array. When it writes the gbF() functions, it itterates through the sorted prefixes and writes a gbF() for each prefix.
This form has a standard set of userfield1..userfield2,comments and a set of dynamically generated fields, and a set of dynamically generated fields. these are named pre10N_userfield1..pre10N_userfield2,pre10N_comments where pre10N is pre100+N. The prefix can be anything, but is sorted alphabetically before being used to add the data to the guest book.
You may need to refresh this page to see the latest updates.