Dear Community,
I had a code on CF5 that worked beautifully and changed the pre-selected dropdown field in a form according to the URL the form was display on.
As an example:
This worked brillant, if the URL was website.com/our-apples, the form dropdown called "preselect" would display "fruitlover".
In CF6, this doesn't work anymore. Surely it just needs some tinkering, but I'm somewhat lost as to WHERE to apply the correct changes. Any suggestions ... ??
I had a code on CF5 that worked beautifully and changed the pre-selected dropdown field in a form according to the URL the form was display on.
As an example:
<?php
$topics = array ("apple", "banana", "orange");
$chose = ''; $counter = 0;
$urli = $_SERVER['REQUEST_URI'];;
foreach ($topics AS $checkit)
{
$counter = 0;
$counter = substr_count($urli,$checkit);
if ($counter != 0) {$pick = $;}
}
if ($wahl == "apple") {$preselect = "fruitlover";}
else if ($pick == "orange") {$preselect = "vitamin-c";}
else if ($pick == "banana") {$preselect = "lovesyellow";}
$form->data['preselect'] = $preselect;
?>
This worked brillant, if the URL was website.com/our-apples, the form dropdown called "preselect" would display "fruitlover".
In CF6, this doesn't work anymore. Surely it just needs some tinkering, but I'm somewhat lost as to WHERE to apply the correct changes. Any suggestions ... ??