How to add placeholder for my form xml field in joomla

I use the built-in Joomla registration form, and I added some fields to this form.

I need to add a placeholder for my form, but the keyword "placeholder" does not work.

registration.xml

<field name="city" type="text" description="Enter your city" 
       label="City" required="true" size="10" filter="string" /> 
+4
source share
3 answers

To add a placeholder, you need to add an attribute hint, for example:

<field name="city" 
       type="text" 
       description="Enter your city" 
       label="City" 
       required="true" 
       size="10" 
       filter="string"
       hint="Placeholder here" />

Hope this helps

+8
source

Add this to edit.php for the specific field:

JHtml::_('formbehavior.chosen','#jform_fieldname', null, array('disable_search_threshold' => 0, 'placeholder_text_multiple' =>'placeholder Value'));

+2
source
<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

-1

All Articles