Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add placeholder for my form XML fields in joomla

I am using Joomla inbuilt registration form and I added some fields to that form.

I need to add placeholder for my form but "placeholder" keyword is not working.

registration.xml

<field name="city" type="text" description="Enter your city" 
       label="City" required="true" size="10" filter="string" /> 
like image 305
ensignpixels llp Avatar asked Dec 15 '22 19:12

ensignpixels llp


2 Answers

To add a placeholder, you need to add the hint attribute, like so:

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

Hope this helps

like image 56
Lodder Avatar answered Dec 17 '22 09:12

Lodder


Add this in edit.php for a particular field:

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

like image 20
Ronak Chauhan Avatar answered Dec 17 '22 08:12

Ronak Chauhan