Jump to content

FormBuilder - Returning certain values from a form submission?


nate
 Share

Recommended Posts

I'm currently working on some paypal integration for a site running on ProcessWire, and it's utilizing FormBuilder for form submission.  What I'm attempting to do is get something that I can use as reference from the submitted form (upon a successful insert) to use for linking into a paypal payment.

Is there any way to get the return of $forms->load()->render() to also return the information of the form INSERT as well as the HTML without much source modification, or perhaps with the 'Success Message' editForm Output tab, include the inserted item's id?  (I see it makes comment about "To display text from a field on another page, enter: /path/to/page/:field or id:field", but that seems to imply pointing to pre-existing items that you have an id for, not pulling the inserted item's id/fields).

Also slightly unrelated to this but also curious about.  Are there any potential drawbacks to adding a new column to the forms_entries table, or will the framework more or less disregard it without problem?
 

(Sorry if this is the wrong place, I saw some references to a FormBuilder forum but I'm not seeing it here or links to it :x)

Edit: It looks like $forms->get() might be the way I want to go, but it's designed around returning all forms it looks.  Is there any way to get $forms->get() to return the most recent item?

Link to comment
Share on other sites

Hi nate and welcome to PW. I don't have Form Builder so I might not be of much help, but you should message Ryan to gain access to the form builder forum board.

Normally in PW ->get returns only one thing. ->find will return an array and you can append ->last() after the selector to get the most recently saved, depending on how the sort order is set up. Unfortunately I am not sure how this works with form builder, but I am sure someone else will chime in with an answer shortly :)

Link to comment
Share on other sites

Yeah unfortunately doesn't appear to be a last() method call in the entries() model.  I'll try to dig around the code though see if I can't manually spot it, hopefully I can find something, else I guess I could end up just adding one in myself.

I'll shoot Ryan a message in a bit if I'm still at this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...