8
votes
Accepted
JForm showon attribute does not work in admin site
Found what the issue is. I was using getInput function to show the field.
$this->form->getInput('field2');
but showon attribute working only if I render the field using renderField function
$...
7
votes
Accepted
Calendar Field Showing Incorrect Date
When no filter is specified for a calendar field, the system will automatically apply the 'user_utc' filter. According to Joomla!'s documentation, this filter, "calculates the specified value to the ...
7
votes
How to get module parameters inside helper function and how to get params inside a custom form field type?
I much prefer going for the OOP approach. This is what I use in one of my extensions. It's Ajax based so I have a separate function to get the parameters.
helper.php:
class ModSomethingHelper
{
...
7
votes
Accepted
How to get module parameters inside helper function and how to get params inside a custom form field type?
1. How to get Modules parameters inside Helper Function
You are going all wrong with this.
First, you can't use $this inside a static method, because they are independent of any instantiated object. ...
6
votes
Accepted
5
votes
Accepted
What does sql_select="e.*" do?
I guess the example you are talking about is this:
"SELECT e.* FROM #__example AS e GROUP BY name ORDER e.id ASC"
Ths basically mean select everything from the table #__example (which has an alias ...
5
votes
Accepted
How to generate a dynamic note field for a custom component?
Use Form::setFieldAttribute(). Typically, this is done in the model's getForm() method. However, if it's cosmetic only, it can be done in the view too.
In /administrator/com_image/models/forms/image....
5
votes
Accepted
How to override a form field in Joomla 4
Apparently, you need to use namespaces in your extension to override fields with the same type. This is because of the class lookup order:
Namespaces added using addfieldprefix attribute or
Joomla\...
4
votes
Accepted
Filter for filelist box to load only png files
Use filter="png" instead of filter="*.png" (remove *.)
4
votes
Remove Archived option from status field
You can either make your own options (see Hasanalsamra's answer) or use the filter option of the status field:
<field
name="state"
type="status"
filter="*,0,1,-2"
label="...
4
votes
How to get module parameters inside helper function and how to get params inside a custom form field type?
Your main module file and template file will have $params variable created by Joomla! core.
If you have static methods, then pass that variable to function call:
class ModTestHelper
{
public ...
4
votes
Accepted
Form field "checkboxes" mutliple default values
Set a comma separated property "checked" in the XML file rather than using default and you should be good. We also do not call trim on the comma separated values as having spaces in values is allowed ...
3
votes
Accepted
Dynamic fields in module parameters
No answers here, but I have managed to work it out for myself. The answer is actually to use both of the solutions I had in mind already -- a custom field type and a subform.
My solution works like ...
3
votes
Accepted
XML form related fields
Have you tried to use Subform field?. It allows you to nest XML forms inside each other or reuse your existing forms inside your current form. And your need, you can combine it with showon attribute.
3
votes
Accepted
Subform multiple data not saving
In your table's bind function, add this:
if ( ( !empty( $array[ 'list_links_url' ] ) && ( is_array( $array[ 'list_links_url' ] ) ) ) ) {
$this->_jsonEncode[] = "list_links_url";...
3
votes
Remove Archived option from status field
Yes, you can make your own options, here is how:
<field
name="state"
type="list"
label="JOPTION_SELECT_PUBLISHED"
onchange="this.form.submit();">
<option value="">...
3
votes
Accepted
Where can I find a good tutorial and/or example for creating front-end forms in custom components?
Everything you need to get started with JForm for views
https://www.ostraining.com/blog/how-tos/development/getting-started-with-jform/
3
votes
Accepted
How to use a regex to validate a FormField?
If there is no native answer I have a solution to do this with an own JFormRule class.
Create a file in your component/models/form/rules directory called regex.php
Insert the source below
class ...
3
votes
How to use a regex to validate a FormField?
You can use Client Side Validation for this, however You will need to make a Custom Form Field for this to happen.
Assuming you're using Joomla 3.4, you first need to initialise the validation script,...
3
votes
Let JForm-Fields be dependent on eachother
Yes this is possible but is a major work around. Joomla has two required verification events. One in he browser and the other on the server just before saving of the form. The browser is the easy part ...
3
votes
Accepted
Documentation tutorial: Why is my JFormFieldList showing a textbox?
The problem is that it is not able to get the field. I see filename you have defined as ulwiz_wmode.php and in class name you are using this JFormFieldUlWiz_WMode. Make sure the naming convention is ...
3
votes
Problems with Custom form field select list
You can check the field from where it is coming,
<? php echo $this->form->renderField('partno'); ?>
This line rendering your field 'partno', by looking into generated html it seems it is ...
3
votes
Accepted
Problems with Custom form field select list
raVan96 is bang on, you should have either a sql field or a list field. But, what you have was an sql field that you have replaced with a custom list field. There are two main issues.
The form xml ...
3
votes
What does sql_select="e.*" do?
When you are only referencing one table in your query, there is no need to explicitly reference the table when writing columns. Also, the default order direction for sql is ASC.
So your syntax could ...
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 ...
2
votes
Accepted
How to Order the fieldsets for a joomla module manualy?
It is technically possible to achieve, but modules aren't really designed with that in mind, so you'd have to override a com_modules view. Personally, I think you have to have strong reason to change ...
2
votes
Accepted
Media field use local or remote file
If you want to use external images for intro or full article image, then you can just paste the image's url in that field.
Similarly, if you want to use external image inside your article body, you ...
2
votes
Subform multiple data not saving
I know this is an old issue, but since a came across this post on my own research I would like to share my solution. Unfortunately I cannot trace back at which Joomla version this possibility was ...
2
votes
Creating custom form field type extended from standard tag field
I have found the easiest way to do this is actually not to use the tag form field at all. I know that sounds crazy, but when you want to store the tags and tag associations in your own database table, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
form-fields-types × 107joomla-3.x × 35
custom-field × 20
jform × 15
form × 12
custom-component × 11
xml × 10
fields × 10
showon × 10
joomla-4.x × 9
component × 8
module × 7
php × 6
development × 6
plugin × 5
editor × 4
joomla-2.5 × 3
joomla-3.4 × 3
jquery × 3
tags × 3
media-manager × 3
calendar × 3
css × 2
joomla-api × 2
database × 2