Forums

Retrieve ID from table for onSubmit

paulsmithx 15 Feb, 2011
Greetings,
I've a form which calls out to a payment gateway in the "on Submit before email section". I am assigning a field called uniquecode in my database. I then use a plugin to call a payment gateway.

I would like to pass the uniquecode recorded in the database record but can't work out how to get that. It isn't available using $_REQUEST.

It's probably something that I should know, so apologies in advance.

Any tips, or pointers in the right direction would be most welcome.
Many thanks,
Paul
GreyHead 15 Feb, 2011
Hi Paul,

The info saved in the database is available after the DB Connection has run in the object $MyForm->tablerow["jos__some_table"]. You can access this from the OnSubmit After Email box provided that you have used the Run Order tab to have this run after the Autogenerated Code (i.e. the DB Connection).

You can't access it before the OnSubmit Before Email code is executed.

I usually generate my own uid in the OnSubmit Before box and use that instead of the long ChronoForms code*.

Bob

* While it is highly unlikely that the long ChronoForms UID will be duplicated, it isn't actually checked for uniqueness.
paulsmithx 17 Feb, 2011
Excellent advice.
Thanks
Paul
This topic is locked and no more replies can be posted.