[英]TYPO3 Fluid - How To Make f:form.textarea Mandatory
I have text fields like this that will turn red and won't let you submit the form automatically if I put the property required
on "1": 我有这样会变成红色,绝对不会让您自动提交表单,如果我把财产的文本字段
required
在“1”:
<f:form.textfield required="1"
property="name"
class="lcapp-formwidth"/>
Now I'm searching for the same in a textarea...the property required
doesn't work here anymore...what would be the "best practice" to make it a required field just like the textfield? 现在我在textarea中搜索相同的内容...
required
的属性不再适用于...将文本字段作为必填字段的“最佳做法”是什么?
<f:form.textarea property="story"
rows="3"
cols="7"
class="lcapp-formwidth" />
It is true, the TextareaViewHelper does not support the required attribute as an argument, but you can add any attribute to a fluid generated tag by using the additionalAttributes
argument. 确实,TextareaViewHelper不支持必需属性作为参数,但您可以使用
additionalAttributes
参数将任何属性添加到流体生成标记。
Eg: 例如:
<f:form.textarea property="story"
rows="3"
cols="7"
class="lcapp-formwidth"
additionalAttributes="{required: 'required'}" />
Notice how additionalAttributes
expects an array notation, where the key is the name of the attribute. 请注意
additionalAttributes
如何期望数组表示法,其中键是属性的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.