Make select dropdown submission redirect user to page
Permalink Browser Info Environment
Hi, I'm trying to create a simple form with a single select dropdown, which sends users to one of several pages depending on the option chosen. Is this something I can do with ProForms, and if so, how do I assign the pages to the options in the select box? Thanks!
Type: | Discussion |
---|---|
Status: | New |
OK, great. So how will I associate this extended functionality with a particular form? There will be multiple such forms throughout the site. Do I just add the controller code to the bottom of the controller.php file in the package root directory?
you would download the extend package linked here:http://www.concrete5.org/marketplace/addons/proforms/...
install that.
You would then open up /packages/proforms_extend_example/models/events/proforms_sbumit.php
Then add a listener for your select value pair in the onSubmit method.
Whenever a form is submitted, this event is fired, and there is a listener in the package that knows to pass the $form object into this onSubmit method.
From there you're golden. You can do whatever you want with the form object non-destructively (whenever we update the package, you don't have to worry about losing changes)
ChadStrat
install that.
You would then open up /packages/proforms_extend_example/models/events/proforms_sbumit.php
Then add a listener for your select value pair in the onSubmit method.
Whenever a form is submitted, this event is fired, and there is a listener in the package that knows to pass the $form object into this onSubmit method.
From there you're golden. You can do whatever you want with the form object non-destructively (whenever we update the package, you don't have to worry about losing changes)
ChadStrat
I am trying to do the same thing but with a radio button, (ie send a user to a different confirmation page based upon that radio button selection on submit). Could you provide an example on how you would do this. Im struggling on how to set up the listener like you stated.
Bump, was this sorted/did you manage it OK? If so, what add-on did you end up using?
you could, for example, inside the on_form_submit method set up a listener for a select values questiontype that has (name)=>(email) pair, and then program an email send to that email.
So, some programming required, but for even a novice programmer, should be pretty easy to do exactly what you want with what is there combined with the proforms extend example package.
ChadStrat