Click to See Complete Forum and Search --> : [RESOLVED] how to auto-add input field when existing input field exists.


rubenhan
11-19-2008, 04:08 PM
Hi, guys.

I'm currently learning PHP and MYSQL and started my first personal project. I just finished creating my registration and login site, which was very satisfying for completing my first part of the project, and would like to start working on my main content part. But I'm stuck on how to tackle these issues. I posted this in "general" section because I wasn't sure if these should be handled with PHP, AJAX, or other ways.

1) So let's say I have a set of input fields generated by HTML form. Once those input fields are populated, I want additional same set of empty fields to appear right below it without reloading the website. Does that mean I have to use AJAX or is there any other more cross-compatible ways to pull this off?

2) When the user has finished adding all his fields, he needs to submit the information to store them in the MYSQL database. Since I do not know how many sets of fields would exist, how do I treat this MYSQL insert? Do I loop them and INSERT each set to the field? Could you give a brief example on how to handle this situation?

I'm sorry, guys, but I would usually google it and find the solution from there but in this case I didn't know where to start. So if you could even give me some keywords that I could use to search google it would be stupendous!

Thank you and have a great day!

rubenhan
11-20-2008, 12:37 AM
I solved the first one and I think the second one pertains to PHP, so I'll ask a question there.