[TYPO3-dev] Flexform / TCA field wizard: Read/write multiple values?

Christian Weiske christian.weiske at netresearch.de
Wed Jun 5 11:40:34 CEST 2013


Hello Philipp,



> > Now my question: Is there a way to get the values of multiple
> > fields in a backend form field wizard?
> 
> AFAIK only via JavaScript. You will need to pass both values and then
> copy the data over. Keep in mind that the actual value is in a hidden
> field.

Thanks. I'm doing that way now; using javascript to access the values:

> 'window.opener.document.editform[' . $this->P['itemName'] . '].value'

This is for the value of the field with the wizard, and for other
field values I replace the field name in P['itemName'] with the desired
field name. In my case:

> 'window.opener.document.editform['
> . strtr($this->P['itemName'], array('lon' => 'lat')
> . '].value'

(fetches that value of the "lat" field instead of the "lon" field)

Some types (like select boxes) don't have a hidden field; in this case
I need to strip the "hidden" away, too:

> 'window.opener.document.editform['
> . strtr($this->P['itemName'], array('lon' => 'zoom', '_hr' => '')
> . '].value'


Using that, I was able to make editing coordinates in ods_osm more
user-friendly, http://forge.typo3.org/issues/48744 .

-- 
Regards/Mit freundlichen Grüßen
Christian Weiske

-= Geeking around in the name of science since 1982 =-




More information about the TYPO3-dev mailing list