[TYPO3-mvc] fluid textarea default value

Bas van der Togt b.vandertogt at profinit.com
Wed Feb 6 21:29:09 CET 2013


Hi Claus,

Thanks for your reply!
This is almost what is want!
When i load a fresh form the default value is now: Dear Kasper,
When i change the default value to: Dear Kasper, How are you?
and submit the form. The textarea is empty.

Any idea?

My form:

<f:form action="create" name="newContact" object="{newContact}" 
arguments="{contactperson: contactperson}" class="form-styled 
contact-form" method="post">
	<f:form.textarea id="message" property="message" class="text" 
value="{f:if(condition: newContact, else: 'Dear Kasper,')}" 
errorClass="error" />
	<f:form.submit value="Versturen" />
</f:form>

Op 06-02-13 21:00, Claus Due schreef:
> Hi Bas,
>
>> If by "user" you mean "integrator":
>
> After reading again the original post I see that's not what you mean.
>
> You most likely just need this:
>
> <f:form.textarea value="{f:if(condition: objectThatTheFormHasPosted, else: 'Your default text - but I recommend you store it in LLL or TS')}" />
>
> You must of course ensure that the object is available in the template
> variables. Or you could check for existence of form errors, if that works
> in your current logic.
>
> Cheers,
> Claus
>



More information about the TYPO3-project-typo3v4mvc mailing list