11001 Posts in 2733 Topics by 1823 members
|Go to End|
31 July 2010 at 3:03pm
I have a User Form defined on my web site and I would like to cause this to redirect to another page after submission in the case of a specific dropdown value.
Is it possible to extend this module to allow this conditional redirection to occur instead of displaying the successful submission page?
31 July 2010 at 6:08pm
What you would have to do is subclass the UserDefinedForm page type to your own class or you could hack round in the module but thats not really recommended.
The redirection is handled in UserDefinedForm::process() (at the bottom) you would need to change that in your subclass to look up dynamically from your form (eg via a switch statement). You can access the fields in the values and fields in the that process function so you would be sweet. Making it work generically would be a bit trickier (eg for more that 1 form) but if its just for 1 form then looking up the value in the $data array wouldn't break too much.
1 August 2010 at 8:27am
I was thinking that some kind of method like that would be the best approach. I'll give it a shot!
Thanks for the support.
|Go to Top|