Questions tagged [jform]

Form Class for the Joomla Platform.

Filter by
Sorted by
Tagged with
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 ...
  • 667
0 votes
0 answers
1k 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 = ...
  • 667
1 vote
2 answers
869 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 ...
  • 418
1 vote
1 answer
216 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....
  • 667
2 votes
3 answers
404 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" ...
  • 667
0 votes
1 answer
846 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 = "...
  • 667
1 vote
1 answer
831 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 ...
  • 667
4 votes
1 answer
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($...
  • 891
0 votes
1 answer
273 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
1 answer
350 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 ...
  • 23
0 votes
1 answer
83 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 ...
  • 5
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 ...
  • 111
2 votes
2 answers
2k 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' ...
  • 418
1 vote
1 answer
671 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="...
  • 2,671
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 ...
  • 2,671
2 votes
1 answer
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,671
2 votes
1 answer
1k 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 ...
2 votes
3 answers
2k views

Height and Width are not considered for an editor Form Field

The XML code I have for the editor form field as <field name="note_desc" type="editor" filter="safehtml" label="Description" required="true" height="150" /> Irrespective of the ...
  • 2,671
3 votes
2 answers
658 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 ...
  • 2,671
0 votes
2 answers
171 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 ...
  • 871
3 votes
1 answer
572 views

How to retrieve active filter from a custom field form?

Having followed the excellent explanation for How to create a view with filters and pagination, I have a custom field that filters for the most part. As it is, the code in the custom field is ...
  • 7,695
2 votes
1 answer
918 views

JForm showon attribute does not work in admin site

I have a form field which needs to be shown depending on value selected for another field. For example <field name="field1" type="list" label="LABEL1" description="DESC1" filter="intval" size="1" ...
  • 2,981
3 votes
2 answers
613 views

Adding Custom Fields to Article Component [Not in attribs field]

I am trying to save some additional fields into the Article Content and there has been a few questions like this relating to this issue but all of the solutions seem to point to saving the extra field ...
  • 1,105
3 votes
4 answers
3k views

JForm in modal window

I create a modal window when clicking on a custom toolbar button, like I was explained here and now the doubt I have is on how to create the JForm for this modal window, because they should submit ...
3 votes
1 answer
90 views

Joomla - PHP+$this wrapped in Javascript.

Here is script I have. I'm trying to load it after page display. I'm trying to execute PHP code from javascript. What I need is to get email address of user who submitted the form at the textbox ...
0 votes
1 answer
141 views

Component's configuration: Save multiple values

I would like to do this in my config.xml of my component: <field name="allowedfiletypes" type="list" multiple="true" label="...
  • 667
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 #...
  • 667
2 votes
1 answer
602 views

How to get the JformFieldList Value by ID

I created a custom field as below class JFormFieldPaddyStatus extends JFormFieldList { protected $type = 'paddystatus'; public function getOptions($id='') { $options = array(); $...
  • 2,671
3 votes
2 answers
501 views

Save Dynamic Array of textboxes

I have developed a code to create dynamic textboxes on click of "Add" button using javascript - Javascript function GetDynamicTextBox(value,index) { return '<input type="text" name="...
user avatar
0 votes
1 answer
403 views

Joomla JForm showon

I would like to extend the functionality of my form I'm using in my admin-backend. To to that I would like to use the showon-attribute, which should only show a field, if the value of this field is -...
  • 667
1 vote
1 answer
577 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, ...
  • 667
1 vote
1 answer
615 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 ...
  • 891
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] => [...
  • 1,292
0 votes
2 answers
827 views

JSON-DATA: Display input in the com_ back-end and save data in the DB

I'm developing my custom component for storing some records in the DB. In my #__records DB table there is the column attribs where I want to store some data in json-format like: {"field1":"value1","...
  • 891
5 votes
1 answer
3k views

How to show a search box inside a list form field

How to show a search box inside a 'list' type of form field?
  • 2,671
1 vote
2 answers
771 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 ...
  • 667
1 vote
2 answers
710 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"...
  • 2,981
1 vote
3 answers
712 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 ...
  • 2,671
0 votes
1 answer
178 views

Joomla Form - Retrieve Values based on ID (Front End)

I'm using jform and joomla's core features of dealing with forms. i.e. Using XML as forms then storing it with JTable etc. My custom component has to deal with CRUD operation strictly at front-end. ...
  • 1,292
3 votes
1 answer
2k views

Load a Single Admin view with multiple tables and forms

We have 2 tables that have data and we need to bring data from both the tables and show in one single view. We have one single XML file which holds the fields of both the tables. The function '...
  • 2,671
1 vote
2 answers
749 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 ...
  • 1,292
2 votes
1 answer
1k 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?...
  • 1,292
0 votes
4 answers
935 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'); ...
4 votes
2 answers
1k views

Building Component - Replace "Invalid Field: My Field" with Custom Message

I am developing Custom Component for Joomla. I did well in validating field by adding custom rule. But if entered value does not pass through my validation, it gives error as "Invalid Field: My Field ...
  • 1,292
2 votes
2 answers
2k 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->...
  • 2,671
1 vote
2 answers
738 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 ...
  • 27
6 votes
1 answer
811 views

Custom XML attributes not showing in HTML markup

Here is the XML for a particular form field: <field type="text" name="first-name" id="first-name" label="MOD_LABEL_FIRST_NAME" required="required" maxlength="27" color="yellow" /> My ...
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:...
2 votes
1 answer
296 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 ...
  • 657
3 votes
1 answer
152 views

JFormFieldRepeatable—can store only one row

I am trying to use the »repeatable« form field. Right now I have this in code in the templateDetails.xml <config> <fields name="params"> <fieldset name="advanced"> ...
  • 377