Forums

on Selecting and on UnSelecting missing from the events dropdown?

joachimliedtke 06 Apr, 2022
Both translation strings are in the language files, but they do not appear in the events dropdown or is there a replacement for both events?
ON_SELECTING = "on Selecting"
ON_UNSELECTING = "on UnSelecting"

EDIT: Apart from the above events with Equals and Not Equals do not save the values. PHP 7.4.3 on Joomla 4.1.2
Colnem 06 Apr, 2022
Hi

If I understand your question (I'm french, so I'm not sure), you can use "Change" Event, then call a javascript function...
joachimliedtke 06 Apr, 2022
Thx for your answer. In CF6 it was possible to monitor changes in the selections of dropdowns and fire a specific change with "on Selecting" and "on UnSelecting". With the "Change" event I cannot react to a selected specific option in the dropdown.
Colnem 07 Apr, 2022
1 Likes
Hi

You can using a javascript function with the Change Event.
For example, you can hide any element if one value of the dropdown is unselected and show it if selected.

But you have to use javascript...

In Add New Event, you choose Add Complex Action / Call function / name_of_your_JSfuntion
Then you create your JS function with a Javascript Element at the top of the form (not check Add Inside domready Event)

An example that I use with Checkboxes Field (never tried with dropdown, but I think it's the same):

function active_actvo() {
if($("input[value='1010'].actvf").is(':not(:checked)')) {$("input[value^='101'].actvo").parent().css("display","none"); $("input[value^='101'].actvo").prop("checked",false);};
if($("input[value='1020'].actvf").is(':not(:checked)')) {$("input[value^='102'].actvo").parent().css("display","none"); $("input[value^='102'].actvo").prop("checked",false);};
if($("input[value='1030'].actvf").is(':not(:checked)')) {$("input[value^='103'].actvo").parent().css("display","none"); $("input[value^='103'].actvo").prop("checked",false);};
if($("input[value='1060'].actvf").is(':not(:checked)')) {$("input[value^='106'].actvo").parent().css("display","none"); $("input[value^='106'].actvo").prop("checked",false);};
if($("input[value='1080'].actvf").is(':not(:checked)')) {$("input[value^='108'].actvo").parent().css("display","none"); $("input[value^='108'].actvo").prop("checked",false);};
if($("input[value='1100'].actvf").is(':not(:checked)')) {$("input[value^='110'].actvo").parent().css("display","none"); $("input[value^='1101'].actvo").prop("checked",false);};
if($("input[value='2000'].actvf").is(':not(:checked)')) {$("input[value^='20'].actvo").parent().css("display","none"); $("input[value^='20'].actvo").prop("checked",false);};

if($("input[value='1010'].actvf").is(':checked')) $("input[value^='101'].actvo").parent().css("display","inline-block");
if($("input[value='1020'].actvf").is(':checked')) $("input[value^='102'].actvo").parent().css("display","inline-block");
if($("input[value='1030'].actvf").is(':checked')) $("input[value^='103'].actvo").parent().css("display","inline-block");
if($("input[value='1060'].actvf").is(':checked')) $("input[value^='106'].actvo").parent().css("display","inline-block");
if($("input[value='1080'].actvf").is(':checked')) $("input[value^='108'].actvo").parent().css("display","inline-block");
if($("input[value='1100'].actvf").is(':checked')) $("input[value^='110'].actvo").parent().css("display","inline-block");
if($("input[value='2000'].actvf").is(':checked')) $("input[value^='20'].actvo").parent().css("display","inline-block");
}


You can replace checked by selected...
joachimliedtke 07 Apr, 2022
Thanks for your assistance. I hope this matter gets officially fixed. This is broken also on Joomla 3.x
joachimliedtke 07 Apr, 2022

EDIT: Apart from the above events with Equals and Not Equals do not save the values. PHP 7.4.3 on Joomla 4.1.2


It seems to be, that the values are saved, but they are not shown after a full save when the editor reloads.
joachimliedtke 07 Apr, 2022
I am on 7.0.9 and the form was made from scratch. Guess what? Equals and Not Equals work now. I wonder what I was doing wrong in the first place. But still the values are not shown after a Full Save, which means I have always to re-enter these values when I edit the form.
Colnem 07 Apr, 2022
Never see this bug on CF7 V7.0.9 scratch Form.
Please, contact the developer...
You need to login to be able to post a reply.