Passing Parameters into a Form

Permalink
Hi,

I'm a beginner and having trouble finding concise information that tells me what I need to know, without overwhelming me with a vast amount of information I don't need to know at this time.

I see I can purchase a big forms handling package that does lots of stuff I don't really need.

A basic form block does most everything I need.

If I have the basic form and select the "Redirect to another page after submission" option, how do I create a vanilla .php file in the right place. This vanilla .php should validate the data, and then redirect to another form passing in some data.

Using "standard widgets" might be the way to go. http://www.concrete5.org/documentation/developers/forms/standard-wi...

But I don't see where to put the php fragments from the "standard widgets" docs.

It would be good if I could find a nice simple example to tweak.

 
dreweinhorn replied on at Permalink Reply
It's been a couple days, and no response.

I was thinking it might be worth buying the PAKT to get my feet on the groud. But from the Table of Contents on the PAKT website forms do not appear to be discussed in this book.

Once again is there a nice example of passing in parameters to a vanilla concrete5 form block.
tlloyduk replied on at Permalink Reply
Bumping this as I would be interested in this too because something so basic seems to be less than obvious. If anyone has a code sample or hint that would be great.
pmarques replied on at Permalink Reply
pmarques
If I understand this correctly, you have requirements that that you can't cover with any core block or addon - this is what single pages are for. Single pages allow you to use custom code, while taking advantage of all of Concrete5 functionality - users, files, validation, etc. Basically you can use Concrete5 as a framework whenever you need a bit of custom development.

There are some tutorials and how-to's on single pages:

http://www.concrete5.org/documentation/how-tos/developers/basic-mvc...
http://www.concrete5.org/documentation/how-tos/developers/shopping_...
http://www.concrete5.org/documentation/how-tos/developers/build-a-s...

Hope this helps!
tlloyduk replied on at Permalink Reply
Thanks for the info....

The bit I am after is as follows.

I've created a form using the Form block. The form works fine, it is a contact form e.g.http://www.domain.com/contact-us

From some pages on my web site (e.g. product) I have a button "Enquire". If you click on the button I'm redirecting towww.www.domain.com/contact-us?product=ABC...

From the contact-us page which contains the form, I need to be able to grab hold of the 'product' parameter and embed it in the form as a hidden form field.

I can't see an obvious (easy) way to do this ? I am not sure single pages would help or are you saying I need to not use the Form block and instead make my own form page from scratch as a Single Page?

Thanks for your assistance
pmarques replied on at Permalink Reply
pmarques
You might not need a single page just to get that parameter, but there is no easy and clicky way to do it. You could override the form block and change it's controller - there's a method called action_submit_form() where data is validated, inserted in the DB and sent by mail, you could try to add your logic here.