Help with Redirect Based on User Input Please!
-
Hi,
Can you provide more detail on how to redirect based on user input? I tried to edit the my-functions.php file, uploaded it and enabled the cforms2-my-functions plugin that appeared(?) but my actions seem to have no effect on my form when submitted, regardless of what value is selected, it always just redirects to the default success page.Can you give an example of what the code should look like in my-functions.php? Am I missing something? It sure seems like I am!
Thank you!
————————–
Here is the code I was trying to use:
function my_cforms_logic($cformsdata,$oldvalue,$setting) {
### example: changes redirection address based on user input field
if ( $setting == “redirection” ){
### note: ‘$$$mypick’ references the ID of the HTML element and has been assigned
### to the drop down field in the form configuration, with [id:mypick] !$userfield = $cformsdata[‘data’][$cformsdata[‘data’][‘$$$cf2_field_14’]];
if ( $userfield == ‘1’ )
return ‘https://yahoo.com’;if ( $userfield == ‘2’ )
return ‘https://google.com’;
}return $oldvalue;
}—————————————-
- The topic ‘Help with Redirect Based on User Input Please!’ is closed to new replies.