• Resolved stutzd

    (@stutzd)


    what I’m trying to do:
    ask the user if they are a member on form A, if they are a member then go to form B, or if they are not a member then go to form C.

    Problem: I am able to have the user go to correct form, When the user clicks submit on the 2nd and last form it goes back to the first form, instead of the success page, so loops are form A to form B back to form A… or form A to form C back to form A…

    Additional info: when i deactivate cforms2-my-functions plugin the forms are able to go to their correct success pages upon submission. Also I have both form A and form B as the last form of the Multi-Part Forms.
    new form test

    The code below is the code I have in the cforms2-my-functions plugin.
    Thanks for any help you may offer.

    <?php
    /*
     * Plugin Name: cforms2-my-functions
     * Description: Find below examples for your custom routines. Do not change the function names.
     */
    
    ###
    ### my_cforms_logic() : gets triggered throughout cforms, supporting real-time configuration
    ###
    ### my_cforms_action() : gets triggered just before sending the admin email
    ###
    ### my_cforms_filter() : after validation, before processing/saving input data (nonAJAX)
    ###                      or in case you'd like to manipulate / check user input before further processing
    ###
    ### my_cforms_ajax_filter() : after validation, before processing/saving input data (AJAX)
    ###
    
    ### TO USE THE FUNCTIOS:
    ###  1) copy this file to your plugin directory
    ###  2) rename it ending with extension *.php
    ###  3) remove the functions you do not need and customize the needed ones
    ###  4) activate this plugin
    
    ###
    ### Your custom application logic features
    ###
    ### "successMessage" 				$cformsdata = cforms datablock
    ### "redirection"  					$cformsdata = cforms datablock
    ### "filename"     					$cformsdata = $_REQUEST
    ### "fileDestination" 				$cformsdata = $oldvalue = array!
    ### "fileDestinationTrackingPage" 	$cformsdata = all SQL data, $oldvalue = array!
    ### "adminTO"  	  					$cformsdata = cforms datablock
    ### "nextForm"    					$cformsdata = cforms datablock
    ###
    ### "adminEmailTXT"					$cformsdata = cforms datablock
    ### "adminEmailHTML"				$cformsdata = cforms datablock
    ### "autoConfTXT"					$cformsdata = cforms datablock
    ### "autoConfHTML" 					$cformsdata = cforms datablock
    ### "adminEmailSUBJ"				$cformsdata = cforms datablock
    ### "autoConfSUBJ"					$cformsdata = cforms datablock
    
    function my_cforms_logic($cformsdata,$oldvalue,$setting) {
    $userfield = $cformsdata['data'][$cformsdata['data']['$$$membership']];
        if ( $setting == "nextForm" ){
    	if($oldvalue == '9' && $userfield == 'yes'){
    		$change =2;
    	}
    
    	if($oldvalue == '9' && $userfield == 'no'){
    		$change =9;
    	}
    }
    return $change;
    }
    ?>

    https://wordpress.org/plugins/cforms2/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘my_cforms_logic makes Multi-PartForms loop’ is closed to new replies.