21
votes
Accepted
What are possible filters in Joomla form fields?
The possible filters are:
rules (Access Control Rules)
unset (Do nothing, thus leaving the return value as null)
raw (No filter)
int_array (Filter the input as an array of integers)
safehtml (Filter ...
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
How to show a search box inside a list form field
You need to load chosen plugin to style list box fields like this.
Load chosen plugin first in your form layout file so that it can add style to your select boxes
JHtml::_('formbehavior.chosen', '...
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
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. ...
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
{
...
5
votes
How do you specify to show only certain editors-xtd buttons on the editor form field type?
What should happen is that you pass a string of comma separated values into the form field of the buttons that you do not want to appear. This gets exploded into an array here: https://github.com/...
5
votes
Accepted
How to insert "php code" inside the .xml manifest file of a Joomla module?
Try this ,
Normally Joomla provides all major components categories in XML accessible way.
For eg: you need banner category dropdown simply use like below.
<field
name="catid"...
5
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....
4
votes
How to insert "php code" inside the .xml manifest file of a Joomla module?
I would suggest taking a look at http://docs.joomla.org/Creating_a_custom_form_field_type
Since it looks like what you are trying to achieve. While the guide may be referring to components this can ...
4
votes
Accepted
How do you specify to show only certain editors-xtd buttons on the editor form field type?
Try something like this:
buttons = "true" | Show all buttons.
hide = "article,image" | An array of the buttons you want to hide.
<field
name="myeditor"
label ="label text"
type="editor"...
4
votes
Accepted
How to add additional field in joomla 3 and 2.5?
I don't see any point to follow a tutorial for Joomla 1.5, when you try to work on J3.
There are so many differences between the 2 versions.
For what you want to do, a simple google search would ...
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
Accepted
Filter for filelist box to load only png files
Use filter="png" instead of filter="*.png" (remove *.)
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 ...
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 ...
3
votes
Accepted
More info required on form field predefinedlist
predefinedlist form field is extending ordinary list field. It allows to create drop downs with predefined options (as name says). Also allowing to add custom options through XML.
For example it's ...
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
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
Joomla list form field change values on runtime
If you are using "Chosen" for your selects then you should trigger "Chosen" to update the data:
jQuery("#jform_state").append("<option value=Bavaria>Bavaria</option>");
jQuery("#...
3
votes
Accepted
Module XML with SQL field (JFormFieldSQL) - Custom Form Field - Check if table exists
Your concern is justified. Indeed, if there is an SQL error, the backend of the module will crash.
If this is a must have for you, I would look into extending the JFormFieldSQL with a custom ...
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
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
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
form-fields-types × 103joomla-3.x × 35
custom-field × 20
jform × 15
form × 12
custom-component × 11
fields × 11
xml × 10
showon × 8
component × 7
module × 7
php × 6
plugin × 5
development × 5
editor × 4
joomla-4.x × 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