문제

I would like to add the target attribute to a FLUID form, so that after submitting the form, a new window is created. This does not work, and produces an error:

<f:form target="_blank" action="..." name="..." id="..." pageUid="..." controller="..."></f:form>

Any ideas on how to make the to open in a new window?

I use TYPO3 6.2beta5

도움이 되었습니까?

해결책

As the f:form ViewHelper inherits from the AbstractTagBasedViewHelper, it shares the same allowed attributes.

The fluid documentation inside the TYPO3 Flow documentation shows you all allowed attributes.

To answer your question, the correct way to use it would be:

<f:form additionalAttributes="{target:'_blank'}">FORMCONTENT</f:form>

Note that the additionalAttributes argument is an array. If you were to add more than 1 custom attribute, you would do it like that:

<f:form additionalAttributes="{target:'_blank', data-validate: 'foo'}">FORMCONTENT</f:form>

EDIT

The AbstractTagBasedViewHelper changed, so the answer as of today for TYPO3 CMS v7 would be: There's an attribute data for that which takes an array of keys and values.

<f:form data="{foo: 'bar', validate: 'baz'}" ....> FORMCONTENT </f:form>

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top