ontarget
Active Member
Hi
I am trying to get form data into /libraries/fabrik/fabrik/fabrik/Helpers/Custom.php
I have tried various methods from https://fabrikar.com/forums/index.php?wiki/php-form-plugin/
I tried to call the function with a calc element - which works with a simple "hello world" and the uniqueclaim_id is a simple field element and does have a value.
But any attempts to use the formModel methods dont work (blank)
I wish to create several functions that use form data which are then called up on the fly using calc elements.
These functions will take different values from the form and a final calc element will total their ouput.
If the form data changes, then the calc elements will trigger the function calls and update a final total element.
Before i go any further with this is this possible using the /libraries/fabrik/fabrik/fabrik/Helpers/Custom.php ?
Does anyone have any examples of a function grabbing some form data.
Thanks
I am trying to get form data into /libraries/fabrik/fabrik/fabrik/Helpers/Custom.php
I have tried various methods from https://fabrikar.com/forums/index.php?wiki/php-form-plugin/
PHP:
public static function doMyThing()
{
$hello = $formModel->_data['aaa_participant_claim___uniqueclaim_id'];
$foo = $formModel->getElementData('aaa_participant_claim___uniqueclaim_id');
$bar = $data['aaa_participant_claim___uniqueclaim_id'];
//$hello = '{aaa_participant_claim___uniqueclaim_id}';
//$hello ="hello world";
return $foo;
//return $bar;
//return $hello;
}
I tried to call the function with a calc element - which works with a simple "hello world" and the uniqueclaim_id is a simple field element and does have a value.
Code:
return \Fabrik\Helpers\Custom::doMyThing();
But any attempts to use the formModel methods dont work (blank)
I wish to create several functions that use form data which are then called up on the fly using calc elements.
These functions will take different values from the form and a final calc element will total their ouput.
If the form data changes, then the calc elements will trigger the function calls and update a final total element.
Before i go any further with this is this possible using the /libraries/fabrik/fabrik/fabrik/Helpers/Custom.php ?
Does anyone have any examples of a function grabbing some form data.
Thanks