…which runs fine in the Lectora Online single page preview (checkboxes disabled at a count of 3 and popups show the correct numbers), but fails once the project is published. The popups still work so the JS is running, but it’s failing to work out how many boxes been selected (popups always show a value of 0).
NOTE: I’ve implemented this JS function on each button rather than at page level as I’ve overridden the default checkbox image, but it works just fine within Lectora. I’ve also followed Sergey’s tutorial on a blank project to test from scratch and I’m still having the same problem. I’ve seen this happen on other JS functions I’ve tested in the past.
The original script is not compatible with Seamless Play Publish. So if you had published with the option “Publish for Seamless Play” unchecked it would have worked fine. To make it work for both cases (Seamless Play and non-Seamless Play), you need to access the HTML elements using getDisplayDocument() function when using jQuery (eg: $(‘input:checked’,getDisplayDocument())).
I attached an updated version of your sample title; please give it a try. I also made another change: instead of putting the same code in each of the check boxes, I made it into a function called processCheckbox() and added to a second HTML Extension of type Header Scripting and call that function from each check box action. That way if you need to make a change to the script you only need to change in one place.