View Full Version : Passing parameters to a Fabrik form
dforrestca
02-06-2007, 03:49 AM
Can anyone point me to an example of calling a fabrik form passing parameters using either the mambot or direct php via URL and where in the logic the form picks up the passed parameters? It seems there's an event for post-processing a form, where's the pre-load processing event?
sure
Lets say we want to pre-populate a form based on some data passed in from the url, e.g. our url is http://www.site.com/index.php?name=rob and we want to show the 'name' parameter in one of our field elements.
Create a new element
give it a name and a label
Enter this into the default text:
$name = mosGetParam($_GET, 'name', '');
return $name;
check the "eval" check box, this will take the default text and parse it as php code, returning the results as the elements default text.
Save the element and you're forms field when called from the url http://www.site.com/index.php?name=rob should contain the text 'rob'
dforrestca
02-18-2007, 12:53 AM
Rob,
I NEED to do this with an image element. There is no "default" or "evaluate" for it. How else can it be done?
how about a field element with this in it:
$image = mosGetParam($_GET, 'image', '');
return "<img src='$name' alt='image' />";
dforrestca
02-23-2007, 08:28 PM
The above suggestion did NOT work...
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.