uri=local(development); browser=firefox2;wp=2.7; my-function.php is in plugins/cforms folder.
I need help understanding the syntax for $cformsdata.
I have a form (say #9) that is part of a multipage form; "next form after this" = form#10. Among other things, form#9 is used to select a 'Diary size' using radio buttons – the options are A5, B5 and A4. Depending on chosen diary size, I want to change the next form to form#11 or form#14 (or leave as form#10). BTW in the table "wp_cformsdata", the field_val for field_name = "Diary Size" is = "A5"or "B5"or"A4".
I've tried several alternatives based on "if ( $setting == "nextForm"){: if ( $oldvalue=='10' && $cformsdata['data']['cf9_field_4-3'] == 'checked') return 14;} if ( $oldvalue=='10' && $cformsdata['data']['diary size'] == 'A4') return 14;} if ( $oldvalue=='10' && $cformsdata['data']['cf9_field_4']=='A5' ) return 10;} if ( $oldvalue=='10' && $cformsdata['data']['cf9_field_4-3'][checked] == 'yes') return 14;} if ( $oldvalue=='10' && $cformsdata['data']['Diary size']=='A4' ) return 14;
If uncertain about how to access the data array and the structure of it, have cforms send you a test mail (the below example is in the file under my_cforms_action()):
The function works perfect when cformsdata is on the current form. But if the data criteria refers to a page prior to the current page then the function doesn't work. Perhaps this is because it relies on trackf.
Example: page1 of a multi-page form has a data field called 'size'. Say, I have completed page 1, page 2, and page 3 in the multi-page form. Now I want to branch depending on the value of "size" in page1. As I see it, the normal syntax doesn't work because it will only 'look' at the cformsdata from page 3.
yes, if you need to access data from a previous multi-part form, you need to access the $_SESSION array, that's where all the data is stored meanwhile.
for testing/understanding you might want to print out the array structure, just add a: