<div class="medium-3 columns">
<label>COUNTRY
<select name="addresseeCountry" id="addresseeCountry"><option value="">Choose Country</option>[[!FormItCountryOptions? &selected=`[[+fi.addresseeCountry]]` &prioritized=`US,GB,DE,RU,JP,FR,NL,CA,AU,UA`]] </select>
</label>
</div>
</div>
This question has been answered by BobRay. See the first response.
&redirectTo=`[[+[[+addresseeCountry:isequalto=`US`:then=`7`:else=`8`]]]]`
<option value="">Choose Country</option>
One way to do it would be with JavaScript. You could make "Choose Country" the first item on the list. On submission, pop up a "Choose a Country" alert and block the submission if that field was still set to "Choose Country".

&redirectTo=`[[+[[+addresseeCountry:isequalto=`US`:then=`7`:else=`8`]]]]`
$country = $hook->getValue('addresseeCountry');
switch ($country) {
case 'US':
$docId = 8;
break;
case 'UK':
$docId = 12;
break;
// etc.
default:
$docId = 8;
break;
}
$docId = empty($docId)? 8 : $docId;
$url = $modx->makeUrl($docId, "", "", "full");
$modx->sendRedirect($url);<script type="text/javascript">
function validateCountry() {
var e = document.getElementById("addresseeCountry");
var optionSelIndex = e.options[e.selectedIndex].value;
var optionSelectedText = e.options[e.selectedIndex].text;
if (optionSelIndex == 0) {
alert("Please select a Course");
return false;
}
else {
alert("Success !! You have selected Country : " + optionSelectedText); // remove this line when it's working
return true;
}
}
</script>
onclick="validateCountry();"
<label>COUNTRY*
<select name="addresseeCountry" id="addresseeCountry"><option value=""></option>[[!FormItCountryOptions? &selected=`[[+fi.addresseeCountry]]` &prioritized=`US,GB,DE,RU,JP,FR,NL,CA,AU,UA`]]</select>
[[!+fi.error.addresseeCountry:notempty=`<span class="error">Choose Country</span>`]]
</label>&redirectTo=`[[+addresseeCountry:isequalto=`US`:then=`7`:else=`8`]]`
It could work if FormIt is setting the +addresseeCountry placeholder based on the $_POST value, but only if you're calling FormIt uncached.
I think you might be better off creating your own postHook that gets the value and redirects on the basis of it. I'm guessing here, but I think it would be something like this:
$country = $hook->getValue('addresseeCountry'); switch ($country) { case 'US': $docId = 8; break; case 'UK': $docId = 12; break; // etc. default: $docId = 8; break; } $docId = empty($docId)? 8 : $docId; $url = $modx->makeUrl($docId, "", "", "full"); $modx->sendRedirect($url);