Questions tagged [jform]
Form Class for the Joomla Platform.
127
questions
1
vote
1
answer
69
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 ...
1
vote
1
answer
19
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::...
0
votes
0
answers
21
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 ...
1
vote
1
answer
113
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>
...
<...
0
votes
2
answers
33
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:
{...
0
votes
2
answers
94
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 ...
1
vote
0
answers
52
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=&...
1
vote
1
answer
82
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/...
0
votes
1
answer
148
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=&...
2
votes
1
answer
179
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 ...
0
votes
1
answer
71
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....
1
vote
1
answer
331
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 ...
0
votes
1
answer
30
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->...
0
votes
1
answer
147
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 ...
0
votes
1
answer
224
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"
...
3
votes
1
answer
288
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/...
1
vote
1
answer
111
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 ...
3
votes
3
answers
314
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"...
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 = ...
3
votes
1
answer
64
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
1
answer
453
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
0
answers
66
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
1
answer
673
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
2
answers
57
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
2
answers
291
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
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 ...
0
votes
1
answer
326
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
2
answers
829
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 ...
1
vote
1
answer
733
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
1
answer
240
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
1
answer
143
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=...
2
votes
1
answer
2k
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
0
answers
115
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
1
answer
396
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
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 ...
0
votes
2
answers
131
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
1
answer
287
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
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 ...
1
vote
1
answer
563
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
1
answer
450
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
1
answer
236
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 ...
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 ...
2
votes
1
answer
784
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
1
answer
728
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
1
answer
335
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?
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 ...
2
votes
1
answer
894
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
1
answer
490
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
1
answer
818
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 ...
6
votes
3
answers
13k
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 $...