Questions tagged [jform]

Form Class for the Joomla Platform.

Filter by
Sorted by
Tagged with
2
votes
1answer
51 views

JS : How to trigger a Blur event with my code

I need help in triggering a Blur event attached to a calendar field. The event I am trying to trigger is added in /media/system/calendar.js around line 1003 JoomlaCalendar.prototype._bindEvents = ...
3
votes
1answer
41 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 />'); $...
1
vote
1answer
20 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
22 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 ...
2
votes
1answer
32 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
2answers
36 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
98 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="...
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 ...
0
votes
1answer
51 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 ...
1
vote
2answers
227 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 ...
0
votes
1answer
187 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 ...
1
vote
1answer
75 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#...
0
votes
1answer
85 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
613 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
0answers
53 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 ...
1
vote
1answer
156 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
49 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 ...
0
votes
1answer
192 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 ...
3
votes
1answer
643 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 ...
1
vote
1answer
380 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 ...
0
votes
1answer
329 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 ...
1
vote
1answer
201 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 ...
1
vote
2answers
870 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 ...
2
votes
1answer
591 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
497 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
256 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?
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 ...
2
votes
1answer
726 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','...
0
votes
1answer
399 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 ...
1
vote
1answer
613 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 ...
4
votes
3answers
10k 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
996 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 ...
0
votes
0answers
748 views

Model/Controller: get id of current item and use it in controller

I got a view in my component's frontend, which catches data from model using the ID of the element: protected function populateState($ordering = null, $direction = null) { $app = ...
1
vote
2answers
810 views

Where can I find a good tutorial and/or example for creating front-end forms in custom components?

I'm building my first component for Joomla 3.x (I don't need support for 2.x). I've created my models (and unit tested them). I'm now ready to create the views. To start I just want to create a simple ...
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....
2
votes
3answers
281 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
461 views

Insert value to custom field using getForm (setFieldAttribute)

I would like to add some data to a form field I declared in my forms.xml. This form field is a custom form field which is declared like this: <fields name = "userdata"> <fieldset name = "...
1
vote
1answer
700 views

Show Form Field if AJAX-response is false

I would like to extend my component with some interaction. For this purpose I try to show fields in a form only if necessary. This works fine with showon-declarations in my form.xml. Now I would like ...
4
votes
1answer
3k views

How to retrieve values of all the fields with JInput but without jform[]

As we know we can retrieve values of all the fields if they have names like name="jform[something]" and we can use the code: $jinput = JFactory::getApplication()->input; $formData = new JRegistry($...
0
votes
1answer
234 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
1answer
263 views

How to add attribute to <form> of backend for module

How can I add the attribute enctype="multipart/form-data" to the <form> tag in the configuration page for a module? That attribute is needed to upload a file to the server. I am trying to ...
0
votes
1answer
78 views

Components Use form.xml without the use of any legacy classes?

How do I without using any legacy structure or classes, use the Joomla feature wich allows you to define forms in an XML file in the folder: JCOMPONENT_PATH/models/forms And then import and use ...
1
vote
2answers
119 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 ...
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' ...
1
vote
1answer
624 views

How to set the form validation only for the fields that are shown

In the admin side I have a XML form with 2 fields as below. Both the fields are marked as required=true <field name="field1" type="text" label="Field1" required="true"/> <field name="...
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
2k views

Loading the options of a select form field via jQuery Ajax

Basically I am trying to load a front-end form select field via jQuery AJAX. The XML form field is <field name="student_ids" type="list" required="true" label="Select Students" multiple="...
2
votes
1answer
845 views

Using JHtml::_('behavior.formvalidator') in JForm gives empty error messages

I'm using Joomla! 3.4 core form validation and it seems to fire perfectly, but the error messages added to the alert are blank, hence I cannot see what the error is. What am I doing wrong? Here is ...