FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
multiple submissions with one form
#1
Is it possible to send multiple submission with one button push?

For example form fields
name1 address1 phone1
name2 address2 phone2
name3 address3 phone3
to add multiple contacts with one form that are put into database as separate entries.

best regards, Hannes.
Reply
#2
Hi Hannes,

There's nothing "out the box" that would let you do this, but it can certainly be done with a little PHP.

Basically what you'd do is still store all those fields in a single form, then on form submission separate them out and create multiple entries. But note: this would require some PHP knowledge (and some spare time!) Smile

- Ben
Reply
#3
Hi, just bumping this in case anybody has time to give me some clues on how to go about this.

I am a junior football league secretary and used the previous version of form tools last season very successfully for player registration. I had the form redirect straight back to the form so club secretaries could enter players names and dates of birth one at a time quite quickly.

It would be really useful if they could enter a batch at a time though.

I love a challenge, if anybody could describe how to do what Ben said above that would be great.

Thanks
Reply
#4
This is something I have done successfully BUT not in formtools. The key lies in designing your sql statement to capture the data you want and then breaking this data up in the rows you want eg

$SQL = sprintf("INSERT INTO $your_table (name, `address`, `phone') VALUES
(name1,address1,phone1),
(name2,address2,phone2),
(name3,address3,phone3)");

The problem is, I have looked in API codes in formtools and can't figure out where to place the mysql statement. Any help will greatly be needed especially with where to place the sql in the API. over to you ben
There are situations where this is needed. especially if one would want to submit many rows of data with one click. This would save some time for the user. I store the data up in one form then break it up on insertion by writing sql in this format

$SQL = sprintf("INSERT INTO $your_table (name, `address`, `phone') VALUES
(name1,address1,phone1),
(name2,address2,phone2),
(name3,address3,phone3)");

The problem is, I have looked in the API codes in formtools and can't figure out where to place the mysql statement. Any help will greatly be needed especially with where to place the sql in the API. over to you ben

This would do a lot of good if the form is recognised in the form list page

Thanks

(Apr 4th, 2010, 12:01 PM)Ben Wrote: Hi Hannes,

There's nothing "out the box" that would let you do this, but it can certainly be done with a little PHP.

Basically what you'd do is still store all those fields in a single form, then on form submission separate them out and create multiple entries. But note: this would require some PHP knowledge (and some spare time!) Smile

- Ben
Reply
#5
Hey guys,

Sorry for not responding sooner.

Interesting... unfortunately it's not possible yet with the API. Victorycck is quite right in that you just need to doctor the SQL insert statement, but there's a quite a lot to consider when making this into a generic feature to be used by any form.

I'm afraid I'll have to give this some more thought when I have more time.

Apologies!

- Ben
Reply
#6
Hey Kelly,

Quote:Great post! It's very nice. Thank you so much for your post.
did you find a solution or are you working on it?

Cheers,
Hannes
Reply
#7
I would love to be a part of the team that will work on re-developing the API to accommodate multiple row submissions at a click of a button.

I really love the simplicity with which you wrote formtools and would love to study it further

Thanks

(Nov 9th, 2010, 8:53 PM)Ben Wrote: Hey guys,

Sorry for not responding sooner.

Interesting... unfortunately it's not possible yet with the API. Victorycck is quite right in that you just need to doctor the SQL insert statement, but there's a quite a lot to consider when making this into a generic feature to be used by any form.

I'm afraid I'll have to give this some more thought when I have more time.

Apologies!

- Ben

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)