I usually create my own PHP scripts for my Fabrik forms, because a lot of the websites I develop require massive customization for most of the form actions.
Things were ok, until I came across this damn drop down list.
I couldn’t get the selected value passed on to the next page using the normal $_POST command.
Cock ah. But I’m good now. :D
Get Drop Down List Selected Value
Ok, if I want to get the value of a form input element, I will usually use this kinda PHP script:
$tval = $_POST['textfield1']; //assign the submitted value to a variable
$ddval = $_POST['dropdownlist1'];
However in Fabrik, you can’t use the $_POST function for drop down lists.
You’ll have to use this script:
$ddval = JRequest::getVar('tablename___dropdownlist1');
$ddval = $ddval; //$ddval stores the selected value
And as usual, to check what value that script fetches by adding this piece of code right below it:
Now go go go, get to work!