Questions tagged [jform]

Form Class for the Joomla Platform.

Filter by
Sorted by
Tagged with
3
votes
1answer
39 views

Creating a multidimensional JForm field dynamicaly

Item Model protected function preprocessForm(JForm $form, $data, $group = 'examplegroup') { foreach ($data as $i => $item) { $field = new \SimpleXMLElement('<field />'); $...
0
votes
4answers
583 views

Remove form fieldset

I am trying to remove a fieldset from a form. I have not found a function that does this, so I do it through an array to remove them individually. $infofield = $form->getFieldset('company'); ...
1
vote
1answer
17 views

Front-end custom Joomla module to upload an image and save it in the Joomla images folder

I work on a custom Joomla module that would let users to upload profile images. I created a JForm and wanted to use the form field type "file" as below: <field name="Photo" type="file" label="...
1
vote
0answers
20 views

How can I get form post data when Save, Save and Close or Save and New button is used?

I need to get the values of fields when the form is saved by any of the save buttons. So far I only get an empty array. Working with a custom field for Mosets Tree component. I used what I expected ...
1
vote
1answer
110 views

How do I pass the generated form together with the custom fields to model class?

I have this code here, which I modified in the getForm function from my Model Class: $elementHeader=' <fieldset name="reportFilters">'; $elementName = $elementHeader; $form ...
2
votes
1answer
27 views

TypeError: Form is Null on Button in Admin toolbar

I am receiving TypeError: form is null in the browser console when I select a custom button added to a form using JToolbarHelper. I can insert the button to any other component as is and it will ...
0
votes
0answers
11 views

JForm bind recursion error?

I'm updating a Joomla 3.x component for Joomla 4, and my admin forms are showing a recursive error: // etc until it hits a limit of 256 236 Joomla\CMS\Form\Form->bindLevel() JROOT/libraries/...
0
votes
1answer
48 views

Form validation in Joomla with form rules doesn't work

It will try to include new rules to validate the fields of a form and it does not work. I can not even get messages on the screen. Am I missing something in the code? Here is my code: <form ...
0
votes
2answers
35 views

Server name removed from text when submitting JForm TinyMCE editor field

I'm working a custom Joomla module that has a JForm with an editor field. My users use this form to edit and send some email messages to our customers. The field is prefilled by the system with some ...
0
votes
2answers
78 views

Jform radio button not displayed or not horizontally aligned with its label

I'm working on a custom Joomla module displaying a JForm with some radio buttons. I'm using the sample code described for Joomla 3+ styling with arbitrary values described here <field name="...
4
votes
3answers
932 views

How to save data from 2 fields as a JSON string to 1 database table field?

I need help to store data in json format in my DB like {name:'1', name2:'2'}. So far I have this: model/form/category.xml: <fieldset> <field name="name" type="text" ...
3
votes
4answers
863 views

How to retrieve unique values before a parenthesis in JFormFieldList Filter query?

I have a JHtml custom filter populated by a JFormField extended class. It is added in the view with the following code: JHtmlSidebar::addFilter( '- Select Height -', 'filter_height', ...
0
votes
1answer
30 views

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

I´m working on a JForm with some list fields. As the fields have a cascading relationship (and I did not want to work with AJAX at this time) I submit the form, whenever the selection of one of the ...
1
vote
1answer
156 views

JFormFieldList in Frontend -> Notice: Array to string conversion

I'm facing a strange problem. I'm trying to define a custom field for the frontend-view of my component like this: defined('JPATH_BASE') or die; jimport('joomla.form.formfield'); jimport('joomla....
1
vote
2answers
187 views

Client side validation - custom event handler not called when user enters the field and leaves it being empty

I'm working on a JForm with some fields with custom event handlers to do client side form validation as it is described in this document The document says that "Joomla adds a blur handler to validate ...
3
votes
1answer
625 views

How to select predefined options in an custom form list-field?

I'm trying to pre-select several options in a custom form field. I created a new JFormField which extends JFormFieldList and gets its values from my database. This is my current code: protected ...
0
votes
1answer
149 views

How to submit JForm form based on custom dropdown list value change

I'm working on a custom Joomla module. I have a JForm that contains multiple custom dropdown lists based on JFormFieldList. The form should be submitted when a value is selected from one of the custom ...
5
votes
2answers
2k views

How to use a custom layout with JForm subform fields?

I want to reuse some forms in my component. The subform field does the job. However, I need to remove some fields and/or field groups when displaying the subform. I tried to use the JForm methods ...
1
vote
1answer
70 views

Why does Joomla remove html tags from submitted text even when filter types are set to raw?

I'm trying to retrieve and save a html formatted text submitted thru a Joomla editor field. I went thru some of the available docs (https://docs.joomla.org/Retrieving_request_data_using_JInput#...
2
votes
2answers
1k views

Array of form fields

I am trying to load a array of form fields as below. grade.xml <field name="gralev_code[]" type="text" class="width20" label="JSCH_GRALEV_CODE" /> default.php $this->form->...
0
votes
1answer
74 views

Joomla editor field type text not posted when submitted

I'm working on a custom joomla module. It has a form with an "editor" type field. The fields are defined in the related xml file: <form> <fields name="main"> <fieldset name=...
1
vote
1answer
561 views

Manually render filter form fields in layout

I am using the searchtools filters in the front end of a custom component. So I am displaying the fields in my template : <?php echo JLayoutHelper::render('joomla.searchtools.default', array('...
1
vote
1answer
367 views

Custom dynamic fields - SimpleXMLElement in model and data info fields

Good morning, I have a question. I create my own fields in my own component. I'm using the "SimpleXMLElement" class. The form generates via getForm work perfectly: $newfieldset = new ...
1
vote
2answers
118 views

Joomla 3.4 custom fields names strange behavior in JForm

I'm working for FE component with form to make ability to user set some values to filter data from DB (ex: select, text). After user make submit these fields need to show values user have selected ...
1
vote
0answers
48 views

Variables in XML form definition

I'm creating a form using the Joomla XML form definition, and I want to create a range of integer values a user can select from. The number/integer field is fine for this use-- but I need to allow the ...
0
votes
1answer
323 views

Radio form field - can value be a string?

I'm using the Joomla radio button form field type and am having trouble with option values that are strings. I'm not sure if I'm doing something wrong or if there is a bug there. So in my component ...
10
votes
1answer
6k views

What are possible filters in Joomla form fields?

I see intermittent use of filter="safehtml" and filter="string" throught Joomla forms. Is there a complete list, and can custom filters be created?
2
votes
1answer
720 views

Render field type in custom form

I'm trying to render the media manager field type in a custom form. The form is not loaded from the xml. this code is causing an error: $obj = new JFormFieldMedia(); $obj -> __set('name','...
1
vote
1answer
136 views

Can I change how jForm generates HTML for the Form fields?

Is there a way to manipulate the resulting HTML that jForm generates? $this->form->renderField('myfield'); Apparent Joomla Default Form HTML <div class="control-group"> <div ...
1
vote
2answers
48 views

Custom fields “on demand”

I've got an article that's a simple event. I don't need any event management extension because I used joomla custom fields to associate to each event some info like speakers, date, .... One info ...
0
votes
2answers
85 views

Jform checkbox not updating in a Module

Sorry I am new to Joomla. I am trying to resolve an issue with the checkbox not updating on the module. I don't see any updating code specified in PHP, but somehow Joomla is updating it. Can someone ...
3
votes
2answers
483 views

Passing Arguments for custom field

I need a custom field which has to select the database with some conditions. When customer A logged in this field has to select records belong to customer A only. The custom field is as below ...
1
vote
1answer
605 views

How to get xml form values in Joomla 2.x?

I'm working on custom Joomla MVC component for Joomla 2.x. I have a .xml file for custom menu item type. I need to get the value_field from it to tell the view what to show from database. I tried and ...
1
vote
2answers
854 views

Custom 'dynamic' form field creation

I tried to look around, but didn't exactly found what I was looking for. Joomla have documentation about how to create custom form fields. That was useful, but what I need is (I guess simple..?). I ...
3
votes
3answers
3k views

Filtering list of Users in User form field type

I've been unable to determine if/how the list of users can be filtered. The example below from User form field type, shows the filter in use, but I've been unable to come up with how to specify the ...
2
votes
3answers
271 views

Filter does not work after clicking grid.published-button

I created a filter for the backend of my component like this: <field name = "category_id" type = "category" label = "JOPTION_FILTER_CATEGORY" ...
0
votes
1answer
182 views

JForm::setFieldAttribute frontend vs backend usage

I'm missing something. I've written a plugin to manipulate specific custom user fields (the new custom fields extension). I create the fields, and make them required, but in /adminstrator I remove ...
1
vote
1answer
973 views

Form-Validation in Frontend

I'm trying to get my component ready for frontend-action. There are some forms that are filled by the user - but of course I have some fields that need specific values (int, float, ...) and some ...
4
votes
3answers
9k views

How to get module parameters inside helper function and how to get params inside a custom form field type?

Part 1: How to get module parameters inside helper function? I am trying to get the same module parameters inside the helper file. class ModTestHelper { public function getFoo () { ...
1
vote
1answer
199 views

Adding fields to user group admin form

I am trying to write a Joomla plugin to add fields to the user group admin form. I have previously written plugins that have added a new tab to the user form. This is possible by having a plugin with ...
2
votes
1answer
572 views

Is it possible to render the same fieldset multiple times?

I'd like to render the same fieldset multiple times for batch create and batch update. Is it possible to do this with JForms? Currently I have a form like this: <?xml version="1.0" encoding="UTF-...
1
vote
1answer
477 views

Server side form validation always returns true

I am trying to validate the input of my form on server side, but I always get true from the validator. What am I doing wrong? .../templates/customer_registration.xml <?xml version="1.0" encoding="...
1
vote
1answer
248 views

Is there an input field to select year only?

Afaik. there is a calendar field by Joomla, which allows you to select a date or probably date range. Is there a way to select a year instead of a date?
1
vote
1answer
373 views

Form Validation - Server Side vs Client Side

Just got confused by seeing both type of validations in Joomla. So far my understanding of these 2 is as below Client Side Validation Done via jQuery/Javascript on the client browser Server Side ...
2
votes
1answer
917 views

Set New XML attribute in custom JFormField

Hi I'm looking to add new field attribute for my custom component. <field type="myfield" mycustomattribute="somevalue" /> Then, I would like to render it in my HTML. Could someone help with it?...
2
votes
2answers
1k views

How do I remove and/or change the 'name' field in the registration form so that I can ask for first and last name separately?

I've developed a plugin that allows me to create a custom user profile. It works and I'm able to add/remove fields as necessary. The issue I'm facing is: How do I remove and/or change the 'name' ...
0
votes
1answer
230 views

Make one of select fields required in a form

I have this form. <?php // No direct access to this file defined('_JEXEC') or die('Restricted access'); JHtml::_('behavior.keepalive'); JHtml::_('behavior.formvalidation'); JHtml::_('behavior....
0
votes
2answers
166 views

Form field type structure

In a Joomla 3.x plugin I need to create several new form field type and in some cases extend already existing core form fields. I know how to do it, but I have some doubts how to structure this files ...
3
votes
1answer
877 views

How to bookmark articles to user profile?

We are developing a Joomla site where different types of articles will be posted and the users will bookmark the article to their user account and display it in their user profile. If there is a ...
0
votes
1answer
375 views

How to implement a phone number field mask in custom component?

How can I implement an input field mask for JForms in my component? Specifically I want a phone number mask something like ()-____. I only want users to enter digits and not have them enter ...