Skip to main content
5 votes
Accepted

How to execute an ajax script to update form fields in an .xml file rendered by Akeeba FOF?

You can use JSON format in the controller directly by adding .json suffix and changing format in your URL to json. In this case the controller would be placed in /administrator/components/com_example/...
Sharky's user avatar
  • 12k
3 votes

How to execute an ajax script to update form fields in an .xml file rendered by Akeeba FOF?

This component is developed using Akeeba FOF, so you need to read the documentation to know how to complete the task. Almost everything is configured using XML, this is to some extent of course. To ...
Mohamed Abdelaziz's user avatar
3 votes
Accepted

Creating a field plug-in, need the com_content form to be enctype multipart

There really isn't a good way to do this. Your best bet is parsing the already generated HTML and making a replacement there. For the component this can be done using onAfterDispatch event. Below is a ...
Sharky's user avatar
  • 12k
3 votes
Accepted

Repeatable field not visible anymore?

Are you talking about the repeatable custom field? If so, then you could try the following: Download a copy of the latest Joomla (3.9.26 as of this writing). Go to the folder /plugins/fields. Copy/...
René's user avatar
  • 46
2 votes

Joomla 3.7.x PHP API set value of custom user field

Don't mess directly with the table! Use the field model which has a setValue function. It allows you to write the value correctly into the database as done in the system plugin.
Laoneo's user avatar
  • 503
2 votes
Accepted

Override output for repeatable custom fields

Here is the solution I came up with for my question: $programs = $fields['programs']->rawvalue; $class = $fields['programs']->params->get('render_class'); $items = json_decode($programs, ...
Mike Hermary's user avatar
2 votes
Accepted

Fields component media field using absolute url instead of relative

I think you are looking for the rawvalue property of the field object /* Rearrange Fields for use */ foreach($this->item->jcfields as $jcfield){ $this->item->jcFields[$jcfield->name]...
jamesgarrett's user avatar
  • 3,339
2 votes

Joomla Field autopopulate on select of another field

You can use the "showon" field attribute to hide/show a field depending upon the value of another field. So you could have lots of Sections fields - one for each Division - and show only the ...
Robbie Jackson's user avatar
2 votes
Accepted

How to update colorpicker fields to Joomla 4.x

Neither form fields, nor their layouts are really designed to be used outside of Form API. Things can break very easily this way. A form instance is expected in some fields and a field instance in ...
Sharky's user avatar
  • 12k
2 votes
Accepted

Get the form fields as defined in the form xml file

There is Joomla\CMS\Form\Form::getFieldset() method for returning an array of fields belonging to a fieldset as Joomla\CMS\Form\FormField objects. $fieldNames = []; foreach ($form->getFieldset('...
Sharky's user avatar
  • 12k
1 vote

Is it possible to create two category fields in the same table with different menu categories to each of them to add new category

I think that the approach you're proposing should work in theory. You can add your shopping details category forms to the admin menu by adding inside your <submenu> tag something like <menu ...
Robbie Jackson's user avatar
1 vote
Accepted

Ordering items function deletes connected field-items of another table

Did you develop the ordering functionality along the lines of the MVC Component Tutorial Adding Ordering step? (The solution for Joomla 4 is very similar, but Joomla components use the draggable ...
Robbie Jackson's user avatar
1 vote

Display only one Category and its sub-categories

You could use the SQL form field type type to get the right categories + their catids. See: https://docs.joomla.org/SQL_form_field_type Or better: create for your component its own Fields that you ...
pe7er's user avatar
  • 2,088
1 vote

How to join custom fields data to users table without extra rows in result set

To better understand your scenario, I've created this db-fiddle with your sample data and made a basic SQL query to display the JOINed data as a tabular result set. SELECT u.id, u.name, u.email, ugm....
mickmackusa's user avatar
  • 4,846
1 vote

Show article fields in module

Assuming this is for Joomla 3, you can use the following: use Joomla\CMS\Factory; use Joomla\CMS\MVC\Model\BaseDatabaseModel; \JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/...
Lodder's user avatar
  • 26.9k
1 vote
Accepted

Should language file definitions/translations be used by multiple forms with the same text?

I started out following the Joomla examples and did have form or view name in all labels but found it easier to just have one definition per extension. For circumstances where you might need an ...
Irata's user avatar
  • 4,361
1 vote
Accepted

Custom field type with showon attribute for list options

This is what I finally did. If someone knows a cleaner solution please let me know. defined('JPATH_BASE') or die; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Form\FormHelper; ...
Mike's user avatar
  • 351
1 vote

Custom fields published state not working as expected

It's unknown what exactly is your $fields variable, what values it contains (how it has been produced), where you use this code and generally your question lacks context. However, note that when a ...
FFrewin's user avatar
  • 19.8k
1 vote
Accepted

How to make field attribute label work

Assuming you're using Joomla's default search tools layout, it does not render labels. You can create a custom layout or a layout override specific to your component. To accomplish the second option: ...
Sharky's user avatar
  • 12k
1 vote

Why doesn't this 'usergrouplist' field show a label?

The problem is likely in your view. What do you get when you print something like the following in your view? <?php echo $this->form->getLabel('view_access'); ?>
itoctopus's user avatar
  • 3,236
1 vote
Accepted

Why doesn't this 'usergrouplist' field show a label?

It worked after I uninstalled and reinstalled the component. So apparently there's nothing wrong with the code.
Glitch's user avatar
  • 297
1 vote
Accepted

How to identify which JForm list field triggered the submission of my form?

Create a hidden field in your form: <field name="example" type="hidden" /> Before submitting the form, populate this field with the ID or name of the field used to submit the form: &...
Sharky's user avatar
  • 12k
1 vote

Form validation in Joomla with form rules doesn't work

The filename must be lowercase and match the name of the rule (not including casing). So rename Custom.php to customnumber.php. Setting the message through $element->attributes()->message doesn'...
Sharky's user avatar
  • 12k
1 vote

How to add placeholder to input field via php variable

You need to follow below steps Go to components/com_yourcomponent/models/forms Find out the xml file which loads that form. Find the fields where you want to add the place holder text. Use hint ...
crazyKida's user avatar
1 vote

How to add placeholder to input field via php variable

I believe that hint is the attribute you're looking for: <field name="name" label="Name" type="text" required="true" hint="Placeholder Text" default="" />
Ben Harold's user avatar
1 vote

Joomla custom fields management

You can do that with the built-in custom field types. Go to Content > Fields Create a field with the name "Speakers" of type "Checkboxes". Create the values (at the bottom of ...
Sakis's user avatar
  • 161
1 vote
Accepted

How could I make Joomla! fields as a function

I presume you're in a template override of com_content. In which case your $this will point to an instance of a view class, eg. ContentViewArticle or something. PHP does allow you to declare ...
jamesgarrett's user avatar
  • 3,339
1 vote

Joomla media extra field without Alt tag

First, you'll need to create a separate field for the alt tag. Make a note of this and the image field's ID. You then need to override the article layout. To do this, copy components\com_content\...
RichardB's user avatar
  • 3,092
1 vote

Joomla field type as star rating

There is no standard form field type for star rating. However, you can decorate a standard form field look like star rating. For example, the below jQuery library can generate star rating using ...
Nagarjun's user avatar
  • 3,001

Only top scored, non community-wiki answers of a minimum length are eligible