I have a php page that displays records from a sql database. Each record is in a repeat region and has a submit form nect to it.

The problem is if I submit one of the forms below the first in the list, the first form is validated and the following error is displayed:

Cannot redeclare process_form() (previously declared

Is it possible to dynamically name the process so that it is different for each record?

Recommended Answers

All 4 Replies

You have three main options, I can think of, in setting up such a script:
1. One form processes all records (including repeats) and process_form() handles all of this.
2. A form for each record set and process_form() only handles that record set. (You can then redisplay the form with all the repeats reloaded, so they can be changed).
3. AJAX.
Let me know which you would like to achieve and I'll try to help.
Ash

Hi Ash

Which of these is best to use?

Am quite interested in the AJAX solution if you have an example.

Can you provide me with a link to what you are doing or paste the form html here?

Member Avatar for diafol

Unless you show the HTML code (especially the repeating section), it is difficult to advise.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.