Questions tagged [jform]

Form Class for the Joomla Platform.

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

Change the form field name from one view to a related one

I have two related views (item and booking) in my custom component. A view for the items, and another view for booking them. So, if you browse to an item view, you will see there a "booking ...
user avatar
  • 207
1 vote
1 answer
40 views

Dynamically add option to Jform field

I need to conditionally add an option to an existing form field in my custom component. The form is defined in models/forms/myview.xml like: <form> <fieldset> ... <...
user avatar
  • 35
0 votes
1 answer
21 views

Fetching custom user field values in custom module

I'm having some problems with a custom module that I'm making to display some basic "logged in" user information. I'm working on a template with "SP Page Builder" CMS. My module: {...
user avatar
  • 1
0 votes
2 answers
64 views

Form-Fields-Fieldset-showon issue

For a component I have a field item_type that needs to be saved in its own database column for ease of searching, filtering etc, and a set of configurations which have global option defaults so are ...
user avatar
  • 51
1 vote
0 answers
44 views

I manually added a field to frontend article submission form but it does NOT save the data. What is wrong?

I created a frontend form override for article submission tmpl/form/edit.php and added the following field as plain HTML <input type="text" name="jform[attribs][videourl]" id=&...
user avatar
  • 178
1 vote
1 answer
73 views

Override module XML form displays correctly but does not save data. Why?

I created a system plugin with the onContentPrepareForm() method to load an entire module options form, and the form loads correctly, but will not save the entered data. The coding /plugins/system/...
user avatar
  • 178
0 votes
1 answer
71 views

get value of hidden field via Jinput

hello i created a form in front via a plugin in my tmpl i create a file value_form.php (compatible with the component) <form id="contact-form-'.$formid.'" method="POST" class=&...
user avatar
2 votes
1 answer
127 views

custom form list field add disabled options - create optgroups

I have a working list based on an sql query. Now I would like to add some spacers (not selectable items). When doing this manually in xml you can add the disabled attr to that item, but how can I do ...
user avatar
  • 483
0 votes
1 answer
60 views

Get linear array of subform repeated values

So have a simple Field a user can enter some IDs in: <field name="ids" type="subform" min="1" multiple="true" layout="joomla.form.field.subform....
user avatar
  • 331
1 vote
1 answer
287 views

Using form XML for custom filter and removing group definition

I'm creating a small component with a search module. I will dumb this example down so that the question will be clear. The component manages books. The book form XML looks like this and its structure ...
user avatar
  • 331
0 votes
1 answer
28 views

Using a different id name for Joomla forms

I have a form in Joomla that uses XML: <form action="index.php?option=com_content&view=contents" method="post" id="adminForm" name="adminForm"> <?php $this->form->...
user avatar
0 votes
1 answer
120 views

Optional fields in renderFieldset

I'm updating a component of mine to use the renderFieldset method and remove some unnecessary code in the form template files. However, some of my fields show / hide based on other preferences in the ...
user avatar
  • 1,089
0 votes
1 answer
202 views

enable Selected option for a custom field extending JFormFieldList

I am creating a custom field extending JFormFieldList as below Form field is defined as below <field name="reltype_rev_id" multiple="true" type="customfield" ...
user avatar
  • 2,651
2 votes
1 answer
197 views

Joomla 4 addfieldpath

Has the addfieldpath parameter in custom extension forms changed in Joomla 4? The Joomla admin is no longer finding my component's customized field types. I'm using addfieldpath="/administrator/...
user avatar
  • 1,089
1 vote
1 answer
103 views

Why does the FormController instantiate models with the ignore_request flag set to true?

The Joomla\CMS\MVC\Controller\FormController::getModel method has a default argument for the config argument that sets the ignore_request parameter to true. This in turn means that models will not ...
user avatar
  • 492
3 votes
3 answers
281 views

Dynamically removing single JForm option

I'm working on a small component and depending on $someoption I need to remove a certain option from the JForm. So for example if $someoption == 1 then I need to remove this option <option value="1"...
user avatar
  • 331
2 votes
1 answer
1k 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 = ...
user avatar
  • 2,220
3 votes
1 answer
62 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 />'); $...
user avatar
  • 331
1 vote
1 answer
367 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="...
user avatar
1 vote
0 answers
63 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 ...
user avatar
  • 178
2 votes
1 answer
609 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 ...
user avatar
  • 2,220
0 votes
2 answers
51 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 ...
user avatar
0 votes
2 answers
278 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="...
user avatar
0 votes
1 answer
35 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 ...
user avatar
0 votes
1 answer
285 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 ...
user avatar
  • 111
1 vote
2 answers
779 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 ...
user avatar
1 vote
1 answer
701 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 ...
user avatar
1 vote
1 answer
223 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#...
user avatar
0 votes
1 answer
141 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=...
user avatar
2 votes
1 answer
1k 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('...
user avatar
  • 408
1 vote
0 answers
111 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 ...
user avatar
  • 1,089
1 vote
1 answer
384 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 ...
user avatar
  • 7,665
1 vote
2 answers
58 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 ...
user avatar
0 votes
2 answers
123 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 ...
user avatar
0 votes
1 answer
284 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 ...
user avatar
  • 585
3 votes
1 answer
1k 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 ...
user avatar
1 vote
1 answer
546 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 ...
user avatar
  • 21
0 votes
1 answer
443 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 ...
user avatar
1 vote
1 answer
232 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 ...
user avatar
  • 610
2 votes
2 answers
1k 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 ...
user avatar
  • 155
2 votes
1 answer
771 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-...
user avatar
  • 381
1 vote
1 answer
714 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="...
user avatar
  • 381
1 vote
1 answer
320 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?
user avatar
  • 381
6 votes
2 answers
3k 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 ...
user avatar
  • 418
2 votes
1 answer
878 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','...
user avatar
  • 21
0 votes
1 answer
479 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 ...
user avatar
  • 418
1 vote
1 answer
793 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 ...
user avatar
6 votes
3 answers
12k 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 () { return $...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
  • 667
0 votes
0 answers
993 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 = ...
user avatar
  • 667