10375 Posts in 2190 Topics by 1707 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 916 Views |
-
User Forms: Conditional Redirection on Form Submission

31 July 2010 at 3:03pm
Hello,
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?
Thanks,
Gary
-
Re: User Forms: Conditional Redirection on Form Submission

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.
-
Re: User Forms: Conditional Redirection on Form Submission

1 August 2010 at 8:27am
Thanks Will!
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.
Gary
| 916 Views | ||
|
Page:
1
|
Go to Top |


