Skip to main content
Nintex Community Menu Bar
Question

Template Custom Button onClick function

  • July 9, 2024
  • 4 replies
  • 53 views

Forum|alt.badge.img+5

I have used the template component with html activated to create a custom

I have also created some inline javascript to detect when the checkbox is clicked:

( inline )
$( document ).ready(function()
{ $(‘#billingCheck’).click(function() {
// Clicked

   });

});

The click listener works until a insert any data into an editor I’m presuming because a models data has changed,

Any ideas?

This topic has been closed for replies.

4 replies

Forum|alt.badge.img+20

I’m still getting used to jQuery selects, but how is the onClick function working when you’ve got the id set to “myBtn” and the jQuery select set to “#billingCheck”?


Forum|alt.badge.img+5
  • Author
  • July 9, 2024

My bad Pat I wrote that off memory!, the Id of the input and onClick are the same in my code and it works until a change is made to any field editor, it’s like the listener is becoming deactivated?.


Forum|alt.badge.img+5
  • Author
  • July 9, 2024

I suppose a better title for this is
“Custom onClick listener becoming deactivated” when changes are made to a model.


Forum|alt.badge.img+5
  • Author
  • July 9, 2024

FIX**, Found the problem, when you use a Template component in a field editor like I did and create a custom button or checkbox with a onClick listener in resources, if the editor is ‘edited’ the button or component will lose it’s eventListener .

Solution: move your custom template component outside of any editors.