Avatar

Level 10

Hi,

I have never had call to use the on/off/neutral checkbox before, so yes I now see the binding. In essence it is still the same process - instead of testing two possible options, you are testing for three.

A couple of things, when using "or", it is better to use a double || which is a logical OR.

Seeing #subform[0] implies that the subform is not named. It is a really good ides (imho) to name subforms as you go, so that it makes it much easier to reference in script. It depends on the volume of script in your form, but I would be inclined to name them.

When you are in the script editor, if you hover over an object that you want to reference and press and old Control, the mouse will change into a 'V'. When you click the object it will insert the full reference into the script for you. Do this a couple of times, when objects are in unnamed subforms or on the master page and you will see when LC automatically uses xfa.resolveNode. When the objects are named, it will just give the minimum SOM.

xfa.resolveNode is needed sometimes. Like when you assign an object to a variable - when you want to use that variable to alter the object, you need to resolve it first. Also if there are unnamed objects or subforms, then the object has to be resolved. Where you have two objects sitting in the same subform and they have different names, then you don't need to resolve the nodes. I would be inclined to drop the xfa.resolveNode where possible. As far as I can recall it adds to the overload in a form, as it needs to continually go off an resolve objects in the middle of the script.

In relation to your counter I would be inclined to drop the xfa.resolveNode; change to || and check the events that the scripts are in (to make sure that they are firing at the correct time).

Good luck,

Niall