My form has a drop-down list with several choices. Once they have filled in all the fields on the page and click SUBMIT, I want to redirect the user to another web page based on the choice they made in the drop-down list. Is this possible?
Create a select-list as you would normally. For this example, we'll name it 'pick,' and give it the following variables:
0;First Choice;value1 0;Second Choice;value2 0;Third Choice;value3
Save your element properties, then save your form.
Now go to your form's properties > Advanced tab > More Options > Submit Pieces tab. In the END SUBMIT section, click on the "Custom" radio button. In the text area that opens, enter the following code:
$this->execPieceByName('ff_InitLib'); $value = ff_getSubmit('pick'); switch( $value ) { case 'value1': header('Location: http://crosstec.org'); exit;break; case 'value2': header('Location:http://crosstec.org/forums.html'); exit; break; case 'value3': header('Location:http://crosstec.org/support/getstarted');exit; break; }
In the $value line, change 'pick' to the name of your select-list element.
In the 'case' lines, change 'value1', 'value2', and 'value3' to the values of your select-list choices, and then change out the location URLs for whatever URLs you want to redirect to.
Click the SAVE button at the bottom of the screen, and then click on the SAVE icon in the upper right-hand corner of the screen to save your form.Upon submit, they will be taken to the URL based on the choice they made.