[TYPO3-dev] FlexForm Help

Osipov Dan dosipov at phillyburbs.com
Thu Feb 21 05:09:24 CET 2008


Thanks Francois, it worked!
I don't know how I missed it - must have been looking elsewhere in the array.
 
Dan

________________________________

From: typo3-dev-bounces at lists.netfielders.de on behalf of Francois Suter
Sent: Wed 2/20/2008 2:55 PM
To: typo3-dev at lists.netfielders.de
Subject: Re: [TYPO3-dev] FlexForm Help



Hi,

> So has no one else had a need to do something like this? Is there no method in flexform to allow this?
> Where would I look to extend the flexform to make this happen?
> 
> I have a simple flexform with two fields. The first one is dynamic, and is populated by an external function. Upon change the form is reloaded. The second is also dynamic, but is based on the value of the first field. How do I achieve that?

I didn't pay attention to that thread before. Yes, it is possible.

In the functions to populate your fields you receive a variable called
$config. Inside this variable is the value of the flexform in
$config['row']['pi_flexform'] (note that this assume that we are talking
about a plugin and that you are using the standard pi_flexform for
storing your data; if that is not the case, change the name of the field
accordinngly).

You can then retrieve the content of the flexform as follows:

$flexFormContent = t3lib_div::xml2array($config['row']['pi_flexform']);

and then extract the value of your first field:

$value = $flexFormContent['data']['sDEF']['lDEF']['dynField1']['vDEF'];

HTH

--

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch <http://www.cobweb.ch/> 
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev at lists.netfielders.de
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev







More information about the TYPO3-dev mailing list