No Code Attached Yet
avatar Didldu-Florian
Didldu-Florian
13 May 2020

Steps to reproduce the issue

  1. Edit administrator\components\com_content\forms\filter_articles.xml
  2. Add a radio button form field like
<field
  name="text"
  type="radio"
  onchange="this.form.submit();"
  default="0"
>
	<option value="0">JNO</option>
	<option value="1">JYES</option>
</field>
  1. Go to administrator/index.php?option=com_content&view=articles and try to toggle that radio button

radio_button_filter

Expected result

onchange="this.form.submit();" should submit the form and the toggled radio button should be selected

Actual result

nothing happens, js event did trigger

System information (as much as possible)

Joomla! Version | Joomla! 4.0.0-beta1-dev Development [ MaƱana ] 17-October-2019 20:21 GMT
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0

avatar Didldu-Florian Didldu-Florian - open - 13 May 2020
avatar joomla-cms-bot joomla-cms-bot - change - 13 May 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 May 2020
avatar Didldu-Florian Didldu-Florian - change - 13 May 2020
The description was changed
avatar Didldu-Florian Didldu-Florian - edited - 13 May 2020
avatar Didldu-Florian Didldu-Florian - change - 13 May 2020
The description was changed
avatar Didldu-Florian Didldu-Florian - edited - 13 May 2020
avatar Didldu-Florian Didldu-Florian - change - 13 May 2020
The description was changed
avatar Didldu-Florian Didldu-Florian - edited - 13 May 2020
avatar Didldu-Florian Didldu-Florian - change - 13 May 2020
The description was changed
avatar Didldu-Florian Didldu-Florian - edited - 13 May 2020
avatar SharkyKZ
SharkyKZ - comment - 13 May 2020

Looking at the code, onchange should be added to each individual option like this:

<option value="0" onchange="this.form.submit();">JNO</option>

It's the same in J3. But different for switcher layout in J4.

avatar Didldu-Florian
Didldu-Florian - comment - 6 Jun 2020

Yeah, did work by adding to option, but thats not clear and too much if you have a large list of options.
Anyway thanks for that info, but someone should fix it.

avatar SharkyKZ
SharkyKZ - comment - 7 Jun 2020

Well, there's an advantage to having this on options - each option can have a different onchange value.

avatar Didldu-Florian
Didldu-Florian - comment - 7 Jun 2020

I don't think it's an advantage. It should be possible to set the handling onchange for all fields equally. If someone else wants to handle it different, he can write a separate field for it.

avatar joomdonation
joomdonation - comment - 12 Nov 2022

As @SharkyKZ pointed out, you can add onchange to individual option. From documentation of our radio form field, onchange is not a supported attribute too. For the time being, it is not really an issue, I'm converting it to discussion and we can discuss further from there if needed.

avatar joomdonation joomdonation - change - 12 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-12 10:23:09
Closed_By joomdonation
Labels Added: No Code Attached Yet
Removed: ?
avatar joomdonation joomdonation - close - 12 Nov 2022

Add a Comment

Login with GitHub to post a comment