Questions tagged [jform]

Form Class for the Joomla Platform.

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

Frontend: why some fields are not in the $data param of the save function?

I'm using a frontend JForm to manipulate some data. The html form is correct, but when it is sent back to the model save function I don't receive all data. This is the data that save receives through ...
Pep Lainez's user avatar
2 votes
1 answer
2k 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 = ...
Irata's user avatar
  • 3,077
2 votes
1 answer
705 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 ...
Irata's user avatar
  • 3,077
2 votes
1 answer
792 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-...
inf3rno's user avatar
  • 381
2 votes
1 answer
903 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','...
marco's user avatar
  • 21
2 votes
1 answer
1k views

AJAX Custom Component - Post data from Editor field

I'm struggling to post data from "editor" form field. When I do it without ajax it shows the value while, with AJAX it just make it blank. Array ( [subject] => asdasdasdasd [description] => [...
Sahil Purav's user avatar
  • 1,292
2 votes
1 answer
299 views

Joomla list formfield stays empty on runtime load

I face the problem, that I have list formfield, where no values have been set in the xml formfield description. The values for the listfield will be created on runtime via jquery. When I choose a ...
Perino's user avatar
  • 667
1 vote
2 answers
867 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 ...
wanderlusted's user avatar
1 vote
1 answer
218 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....
MyFault's user avatar
  • 667
1 vote
3 answers
714 views

getUserState() return array where as getItem() return JObject

I am facing a problem with the function loadFormData where there is check whether to pull data from the session or from the table. protected function loadFormData() { // Check the session for ...
Malaiselvan's user avatar
  • 2,671
1 vote
1 answer
234 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> ... <...
Marcel's user avatar
  • 35
1 vote
2 answers
870 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 ...
nimble's user avatar
  • 418
1 vote
1 answer
360 views

Joomla JForm SQL-Field: Get condition from global configuration

i got the following field in my form.xml-definition: <field name="attachedto" type="sql" label="COM_BESTIA_FIELD_ATTACHEDTO" query="SELECT id, title FROM #...
MyFault's user avatar
  • 667
1 vote
1 answer
580 views

Let JForm-Fields be dependent on eachother

I would like to solve this problem: I got some Fields in my Form. Some are Combo-Boxes, Radio Buttons, Text-Inputs and so on. Now I would like to do the following: If Radio-Button 1 has value 1, ...
MyFault's user avatar
  • 667
1 vote
2 answers
751 views

How to set custom input data in Model

I'm using JTable for CRUD on my application. I've created method in model to save data in database I need to add custom inputs "created" and "created_by" as shown in "$custom_data" variable and save ...
Sahil Purav's user avatar
  • 1,292
1 vote
1 answer
87 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/...
Nadal's user avatar
  • 188
1 vote
1 answer
752 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 ...
wanderlusted's user avatar
1 vote
1 answer
252 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#...
wanderlusted's user avatar
1 vote
2 answers
59 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 ...
user1463905's user avatar
1 vote
1 answer
834 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 ...
MyFault's user avatar
  • 667
1 vote
1 answer
675 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="...
Malaiselvan's user avatar
  • 2,671
1 vote
1 answer
620 views

Two left joins and multiple parents for a single record

This issue is extending of the question(s) by the link joomla.stackexchange.com/a/9836/4042 but with condition when child record has not only ONE parent (parent record) but MANY. With two left joins ...
stckvrw's user avatar
  • 891
1 vote
2 answers
273 views

CKform Checkbox issue

I'm using Ck forms component to build my forms. Every things works fine, except checkbox, they are not like what is planned. My question is : how to align them one next to one, and how to match Value/...
Angelika's user avatar
  • 113
1 vote
1 answer
1k views

Add onclick/onsubmit event to form submit

I have made a plugin that add few fields on joomla registration form. Now I need to add a javascript event on submit that will handle those extra fields I added, but I couldn't find any way to ...
Terix's user avatar
  • 185
1 vote
1 answer
359 views

Adding all form parameters in a custom item of the component

I prepared a component and i have to add different categories and custom items with lots of fields in my component.But What i want is to display all the joomla's fields for adding a new item in my new ...
dev-m's user avatar
  • 1,341
1 vote
1 answer
117 views

I want to display a form with the data added already

public function getLaymanLayout($id){ $form = $this->getForm(); $form->bind(0); } I still have a lot to implement and make it correct to the MVC rules. I want to call a table from the ...
DeesreX's user avatar
  • 87
1 vote
1 answer
26 views

Trying to find the right syntax for prefilling a subform in J3.10

I'm trying to figure out how to prefill subform repeatable fields - the situation is: /com_manufacturing/admin/views/document/tmpl/edit.php //some code <?php // $subform = JForm::...
Jonathan Bellieri's user avatar
1 vote
1 answer
355 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 ...
Mike's user avatar
  • 341
1 vote
1 answer
509 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="...
wanderlusted's user avatar
1 vote
1 answer
398 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 ...
GDP's user avatar
  • 7,705
1 vote
1 answer
581 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 ...
K.I.D.'s user avatar
  • 21
1 vote
1 answer
237 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 ...
Simba's user avatar
  • 610
1 vote
1 answer
830 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 ...
user8693's 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 ...
MyFault's user avatar
  • 667
1 vote
2 answers
126 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 ...
CodeBy's user avatar
  • 111
1 vote
1 answer
396 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 ...
Malaiselvan's user avatar
  • 2,671
1 vote
2 answers
780 views

Dynamically change the "readonly"-tag of JForm Field

I got a JForm and I got some fields in there. I would like to disable a field, if the value of another field is "0". I know that I can do that by preparing the form while loading, but I want to solve ...
MyFault's user avatar
  • 667
1 vote
2 answers
717 views

Filter form field values by language

I have a specific requirement of showing categories of selected menu language only. So in my component, I have the field declared as below. <field name="catid" type="categoryedit" label="JCATEGORY"...
Nagarjun's user avatar
  • 2,981
1 vote
2 answers
743 views

3.x form array?

Is there a way to have the same field in an array when posting the data? Since I need the tabs in my component to be generated dynamically depending on the querys output, I can't enter them ...
Vic's user avatar
  • 27
1 vote
1 answer
2k views

Dynamically add fields to component's menu edit form

I am looking to add parameters to the edit-view of my component's menu editor on the fly instead of statically defining them as you normally would (as described : https://docs.joomla.org/J3.x:...
Aaron Hudon's user avatar
1 vote
1 answer
202 views

Accessing Form fields in the Model

I was able to get and set values of my custom form fields by using $form->getValue and $form->setValue in my previous issue here: How to access / modify custom form fields values However, I am only ...
Break the Law's user avatar
1 vote
0 answers
57 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=&...
Nadal's user avatar
  • 188
1 vote
1 answer
113 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 ...
Dom's user avatar
  • 512
1 vote
0 answers
67 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 ...
Nadal's user avatar
  • 188
1 vote
0 answers
122 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 ...
user101289's user avatar
  • 1,109
1 vote
1 answer
734 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="...
inf3rno's user avatar
  • 381
1 vote
1 answer
347 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?
inf3rno's user avatar
  • 381
1 vote
1 answer
122 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 ...
Break the Law's user avatar
0 votes
1 answer
860 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 = "...
MyFault's user avatar
  • 667
0 votes
2 answers
109 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 ...
RogerCO's user avatar
  • 51