我正在使用Joomla内置注册表单,我在该表单中添加了一些字段。
我需要为我的表单添加占位符,但是"占位符"关键字无效。
registration.xml
<field name="city" type="text" description="Enter your city"
label="City" required="true" size="10" filter="string" />
答案 0 :(得分:8)
要添加占位符,您需要添加hint
属性,如下所示:
<field name="city"
type="text"
description="Enter your city"
label="City"
required="true"
size="10"
filter="string"
hint="Placeholder here" />
希望这有帮助
答案 1 :(得分:2)
在 edit.php 中为特定字段添加此内容:
JHtml::_('formbehavior.chosen','#jform_fieldname', null, array('disable_search_threshold' => 0, 'placeholder_text_multiple' =>'placeholder Value'));
答案 2 :(得分:-1)
<field name="mytextvalue" type="text" label="Enter some text" hint="Some placeholder about the field" />
有关详细信息,请查看Joomla文档 https://docs.joomla.org/Text_form_field_type/3.2