Questions tagged [jform]
Form Class for the Joomla Platform.
126
questions
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 ...
0
votes
2
answers
68
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
1
answer
411
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
1
answer
116
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 ...
1
vote
1
answer
159
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
28
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::...
1
vote
1
answer
403
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
1
answer
100
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....
0
votes
2
answers
145
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
63
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
95
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
232
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=&...
1
vote
1
answer
394
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 ...
2
votes
1
answer
282
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 ...
3
votes
3
answers
368
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
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->...
0
votes
1
answer
36
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
188
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
253
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
425
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/...
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
3k
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
69
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 />');
$...
0
votes
4
answers
978
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');
...
1
vote
1
answer
558
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
77
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
733
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
62
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
320
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="...
5
votes
3
answers
2k
views
How to save data from 2 fields as a JSON string to 1 database table field?
I need help to store data in json format in my DB like {name:'1', name2:'2'}.
So far I have this:
model/form/category.xml:
<fieldset>
<field
name="name"
type="text"
...
3
votes
4
answers
1k
views
How to retrieve unique values before a parenthesis in JFormFieldList Filter query?
I have a JHtml custom filter populated by a JFormField extended class. It is added in the view with the following code:
JHtmlSidebar::addFilter(
'- Select Height -',
'filter_height',
...
0
votes
1
answer
39
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 ...
1
vote
1
answer
219
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....
1
vote
2
answers
929
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 ...
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
783
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 ...
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 ...
1
vote
1
answer
269
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
151
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
1
answer
590
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 ...
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 ...
1
vote
0
answers
130
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 ...
0
votes
1
answer
462
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 ...
16
votes
1
answer
9k
views
What are possible filters in Joomla form fields?
I see intermittent use of filter="safehtml" and filter="string" throught Joomla forms. Is there a complete list, and can custom filters be created?
2
votes
1
answer
904
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','...
1
vote
1
answer
399
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
61
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
134
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 ...
3
votes
2
answers
671
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
...