Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jform]

Form Class for the Joomla Platform.

0
votes
1answer
27 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
24 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
81 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
52 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
41 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#...
-1
votes
1answer
37 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
221 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
38 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
55 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
44 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
76 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
116 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
379 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
297 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
267 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
181 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
756 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
477 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
367 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
217 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
657 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
287 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
519 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 ...
5
votes
3answers
8k 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
842 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
640 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
741 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
141 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
235 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
393 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
589 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
193 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
225 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
68 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
116 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
509 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
354 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
766 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
3answers
1k 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 ...
3
votes
2answers
404 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 ...
0
votes
2answers
163 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
424 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 ...
1
vote
1answer
620 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" ...
3
votes
2answers
548 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 ...
3
votes
4answers
2k 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
1answer
86 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 ...