I picked out parts of the script to use so I can debug it piece-by-piece and make sure each part works. I'm only using the form to add related table records for existing features, so I did not include the functionality to also view existing records or update records, etc. So far I've got it to work for a one-page form, so now I'll modify to work for a multiple-page form.