Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

looking for a way to dynamically create a set of form fields



8:48 pm on Dec 9, 2011 (gmt 0)

5+ Year Member

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.




4:00 am on Dec 10, 2011 (gmt 0)

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

In the script I'd include a radio box "Another location" with increment count to display the next insert info. How all that stuffs into your database is a different aspect as you will end up with unequal fields (I'm old school and not all that nifty in that regard... I like structured data).

Featured Threads

Hot Threads This Week

Hot Threads This Month