Checkbox events in editor popup modal
Checkbox events in editor popup modal
Hello
I try to catch events of a checkbox in the popup modal of Editor (bootstrap). Using F12, I can see the id but the following is not working.
$('#DTE_Field_Name_Enabled_0').on('click', function () {
alert('xx');
});
The checkbox field is defined like this
{
label: currentCulture == 'de-CH' ? "Actif" : "Active",
name: "Enabled",
type: "checkbox",
separator: "|",
options: [
{ label: '', value: 1 }
],
unselectedValue: 0
}
Could you please tell me what's wrong or how to catch this event?
Thanks
Pierre
Replies
Sounds like the checkbox
#DTE_Field_Name_Enabled_0
is not in the DOM when you are creating the event handler. I would look at using theopen
oropened
event and place the event handler code in the event.Kevin
Thanks for the reply Kevin
I tried both events without success...
Try:
field().input()
will get theinput
element.If that doesn't help, can you give us a link to a test case showing the issue please?
Allan
Hi Allan
It works fine. Thanks!
Pierre