I'm using Client side events on a Select field to show/hide fieldname "Trainer".
I modified the example given here
The default value for my field is "1" (as that's the most commonly required option).
When I select value "2", the field "Trainer" becomes invisible as expected.
However, if i then change the selection to either 1 or 3 the fields do not become visible again, and in fact the select drop-down still shows value 2 as highlighted.
What am I doing wrong?
{ // keys = event types, values = handler functions
"change": function(e) {
// Your code
if (this.value = "2") {
$(this).fields("Trainer").visible(false); // true to show, false to hide
} else {
$(this).fields("Trainer").visible(true);
}
}
}
v2022.12.4