Hot answers tagged

20 votes
Accepted

How to save Custom Fields in Core components

The AHA! moment - #__content no longer has the params column, so the following adjustments have to be made for the plugin to work with components/tables with attribs instead of params (which appears ...
user avatar
  • 7,665
5 votes
Accepted

Item being edited was created as a new record instead of saving changes after clicking submit

Make sure that your form has an ID field. Without the ID field, Joomla! will create a new record, even when editing. It is okay if the ID field is hidden.
user avatar
5 votes

Where can I find list of the available Joomla-WYSIWYG-Editor buttons etc

Every folder inside the following folder is a plugin for Tiny-MCE editor: /media/editors/tinymce/plugins/ They are: advlist anchor autolink autoresize autosave bbcode charmap code colorpicker ...
user avatar
  • 2,275
4 votes
Accepted

Where can I find list of the available Joomla-WYSIWYG-Editor buttons etc

These buttons are coming from the editors XTD plugins. The defaults XTD buttons are article, pagebreak, readmore, image. But there are extensions that can install their own XTD buttons, e.g Joomla ...
user avatar
  • 19.5k
4 votes

Alter registration and comment forms

I think you will need onContentPrepareForm() for that, then you can load your fields in it. Here is a good tutorial how to make it. To attach a js onclick event to the submit form, you will need to ...
user avatar
  • 4,045
4 votes
Accepted

Custom XML attributes not showing in HTML markup

Though the XML file and the rendered HTML both call them attributes, there is not a direct pass through of values. Hence, only some attributes make it to the HTML (and some extra attributes are added)....
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 ...
user avatar
  • 1,006
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 ...
user avatar
  • 4,045
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 ...
user avatar
  • 2,651
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 ...
user avatar
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 ...
user avatar
  • 8,306
3 votes
Accepted

Components > Paypal Button not saving properly, neither iframe

Most probably your article editor (TinyMCE?) is cleaning up your code. This is expected behavior by default. Both <iframe> and <form> are among the tags that are removed automatically by ...
user avatar
  • 13.3k
3 votes
Accepted

How to Create a Foreach Loop that Returns Users In a Specific Usergroup

To answer the actual question, this code will give you a listbox of UserIDs and Names. Retrieving all the extra data would then just be a SQL select statement $myGroupID = 2; //Your User Group to ...
user avatar
  • 7,665
3 votes
Accepted

Joomla CSRF form validation

FoF has a handy _csrfProtection routine in the controller, with several ways to check the token: JUtility::getToken() (for Joomla 2.5, removed from Joomla 3.x) $session->getToken() $session->...
user avatar
  • 7,415
3 votes
Accepted

joomla protostar formfield width responsivness

The following classes can be added to your input field in order to control the size: class="inputbox input-mini" class="inputbox input-small" class="inputbox input-medium" class="inputbox input-...
user avatar
  • 13.3k
3 votes

How to create contact form from scratch

I have recently encounters an extension JxiForms which is pretty unique in its functionality. You should give it a try if you need complete control over the form data. It does not interfere in the ...
user avatar
  • 1,791
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 ...
user avatar
  • 4,045
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 ...
user avatar
  • 402
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' =&...
user avatar
  • 2,971
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 ...
user avatar
3 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 ...
user avatar
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/
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.
user avatar
  • 2,388
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 ...
user avatar
  • 2,087
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 ...
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 ...
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 ...
user avatar
  • 19.5k
3 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\...
user avatar
  • 8,306
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://...
user avatar
2 votes

How to create contact form from scratch

Why do you waste your time writing code for a contact form? There are a lot of Joomla forms extensions available. Fabrik is such an example. You can create as many fields as you like. Visforms is ...
user avatar
  • 49

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