Hi Everyone, Like the subject says, I'm looking for a way to dynamically create a set of form fields. Here is the scenario: I'm going to have a customer information form, with company information (business name, address, phone, etc). If the company has more than one location, I need to be able to click a "New Location" button and create a new set of fields for that location. I'm not sure how many times I'll need to create a new set of fields, but at least once or twice, I'm sure. I will also need to be able to send the form data to either an email address or a database of some kind. I have a PHP script that I use to send form data to an email address, but nothing to send the data to a database. For now, the email script should be fine. Still I need to be able to send the dynamically created field data. Not sure how to do that. The PHP script I'm currently using specifies the field names. Unless I would just add code based on what the new field names would be (I would think a more dynamic approach to this would be better tho). Any advice on which direction to go with all this would be greatly appreciated. Thanks! Steve
Put 3 (or more) sets of fields in hidden divs. As the user clicks "more", unhide the next div. Send all the fields to the server and parse out whether the field is filled or blank at the server. Email the non-blank fields. Saving the data in a database is trivial once it's on the server. Open a connection to the database and use INSERT statements to add the data.
Thanks for the reply, Rukbat. This sounds like pretty much what I was thinking, but I don't know how to make it work. Could you point me to, or send me, some example code? Thanks for your help! Steve