Hot answers tagged

5 votes
Accepted

Prefill subform with data rows

You need to put the subform data one array deeper. This is because your subform has multiple attribute which means the data should be represented by multiple rows: $prefillData = array("contacts&...
Sharky's user avatar
  • 9,936
4 votes

Submit a view instead of redirect to another view

Answering my own question... I should have spend some time in google before asking my question. Joomla supports CSRF anti-spoofing and it is explained in How_to_add_CSRF_anti-spoofing_to_forms Since ...
Malaiselvan's user avatar
  • 2,671
4 votes

Populate multi select data into the custom list field of form inside user management

You are doing it completely wrong. Never make core changes to files/classes because there are big chances that you will lose everything on the next CMS update. Instead use plugins. It is the best way ...
Dmitrijs Rekuns's user avatar
4 votes
Accepted

Joomla 3 form validation

The required="required" is standard HTML5 validation, - the html5fallback.js is just a polyfill for those browsers that do not support html5 validations. To answer your question add novalidate to ...
Rob Clayburn's user avatar
  • 1,006
4 votes
Accepted

JFormFieldList in Frontend -> Notice: Array to string conversion

I think you want to use use getOptions(..) not getInput(...) with a JFormFieldList. getInput returns the full <select /> input as a string. getOptions populates the select options with an array ...
David Hayes's user avatar
4 votes
Accepted

Is there an easy way to build a form in Joomla that stores the currently logged in user's name?

If you don't need to use the username for something else (which might require coding that you're trying to avoid), I know that RSForms has global placeholders for data it automatically saves for the ...
Patrick Jackson's user avatar
4 votes
Accepted

How to override a form field in Joomla 4

Apparently, you need to use namespaces in your extension to override fields with the same type. This is because of the class lookup order: Namespaces added using addfieldprefix attribute or Joomla\...
Sharky's user avatar
  • 9,936
4 votes

Is the following everything one should do to prevent SQL injection?

First, when reading user input you should make sure it's the correct type. The Input/Filter APIs don't handle array/string conversion. So if you're expecting STRING filter to return a string be aware ...
Sharky's user avatar
  • 9,936
3 votes
Accepted

Check a form field for duplicates before saving

The best place is your table class before storing data. For example below code in store function of table class. public function store ($updateNulls = false) { if ($table->load(array('alias' =&...
Nagarjun's user avatar
  • 2,981
3 votes

Editor stripping Script

I have had similar issues in the past where scripts seem to be stripped regardless of the text filter settings. Temporarily Disable Editor As a temporary work around, you can temporarily set the ...
Neil Robertson's user avatar
3 votes

Overriding save() method on form, how do I redirect to or show the form again after raiseError or enqueueMessage?

You should use a session to save the form data. In the CMS there is a special User State for this. Just before you return false you should save the current data into the user state: // Save the form ...
Dmitrijs Rekuns's user avatar
3 votes

Let JForm-Fields be dependent on eachother

Yes this is possible but is a major work around. Joomla has two required verification events. One in he browser and the other on the server just before saving of the form. The browser is the easy part ...
Llewellyn's user avatar
  • 401
3 votes
Accepted

Where can I find a good tutorial and/or example for creating front-end forms in custom components?

Everything you need to get started with JForm for views https://www.ostraining.com/blog/how-tos/development/getting-started-with-jform/
Walt Sorensen's user avatar
3 votes
Accepted

XML form related fields

Have you tried to use Subform field?. It allows you to nest XML forms inside each other or reuse your existing forms inside your current form. And your need, you can combine it with showon attribute.
webchun's user avatar
  • 2,398
3 votes
Accepted

How to to create a multi-layered form system

The short answer is: you will need the assistance of a Joomla Programmer as it's highly improbable you'll find a plug-in that suits your requirements. First of all, I think what you are looking for ...
NivF007's user avatar
  • 2,097
3 votes

joomla loadFormData

I ran into this as well and have learned the following: the loadFormData can indeed used to load previously saved data back into the form and Joomla does not seem to set the form data to the user ...
Isolde's user avatar
  • 131
3 votes

Assign user to a specific group based on custom field selected

Write user plugin which will have the below file structure plugins/user/plugins_name/ plg_add_group.php plg_add_group.xml plg_add_group.xml - Write plugin manifest code here you can ...
Sudhir Sapkal's user avatar
3 votes
Accepted

User Registration Assign to Specific Group

Briefly, these are your main options: Write a custom user registration component Write a User Plugin that will handle the usergroup of the registered users Use 3rd party Form extensions which ...
FFrewin's user avatar
  • 19.6k
3 votes
Accepted

Component/module for registering to get document

You can create a form that prompts for an email address and then provides a download link using most of the forms extensions available in Joomla. There are plenty of them available at https://...
Neil Robertson's user avatar
2 votes
Accepted

Custom fields in com_content does not display when editing article in front end

In front article edit form there are only selected fields added. If you want to add something there you will have to use Template Overrides to edit this file: /components/com_content/views/form/tmpl/...
Artur Stępień's user avatar
2 votes

Create or edit an article using a form in the frontend in joomla 3.0

I would consider SEBLOD or Form2Content for this task depending on the overall complexity of your project. Choose form2content if you want to get up and running quick (uses smarty php for templating )...
mrleira's user avatar
  • 21
2 votes

Joomla 3 submit a form via AJAX after javascript checking fields validation

There are several ways to prevent an auto submit: Attach the handler to the button, instead of form and return false to stop any further action Remove action attribute from form tag, you can define ...
Anibal's user avatar
  • 7,415
2 votes

Unable to insert form values in to database Joomla 3

Just a little to expand on @Sahil Purav's answer. The reason why your values might not be being stored as they should is because you need to define a filter in your inputs. Try adding RAW to all of ...
Lodder's user avatar
  • 26.8k
2 votes

Is the new 'showon' attribute only for back-end forms?

It should work as long as your form is generated using JForm. If you build your HTML for the form yourself, then you may have to manually add the needed code and markup. Try rendering the field using &...
Bakual's user avatar
  • 5,537
2 votes

Is the new 'showon' attribute only for back-end forms?

I guess it's a problem related to system core, Your template/Joomla don't load JS for that functionality, just add JS /media/jui/js/cms.js in your controller where you load form. regards
Lanah's user avatar
  • 522
2 votes

Joomla token with ajax request

First of all this sounds very weird. When opening the page in two browsers, Joomla should generate two different session ids (check the cookies that Joomla generates, they should be different!). ...
Valentin Despa's user avatar
2 votes

Custom bootstrap error message

Let's say I've custom validator "validemail" added in my form XML: <field type="text" label="COM_HELPDESK_CC_LABEL" description="COM_HELPDESK_EMAIL_DESCRIPTION" ...
Sahil Purav's user avatar
  • 1,292
2 votes
Accepted

Create form in frontend in a module

Personally, I would do it like this: Lets say you have a few form fields (for example, 2 inputs and a select box): <form method="post" name="shout"> <input name="myform[name]" type="...
Lodder's user avatar
  • 26.8k
2 votes

Editor stripping Script

TinyMCE removes empty tags by default, so a tag like <script src="myScript.js"></script would be removed because it's empty. You can try changing the settings of the TinyMCE plugin (...
johanpw's user avatar
  • 13.3k
2 votes

How to develop a survey extension which prevents respondents from taking a survey more than once?

Some more ideas: Save a cookie in the user's browser. Get users IP address and store in BD.
Piero Marsilio's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible