When a client script calls g_form.clearValue on a select Box or Yes/No variable, a change is detected and triggers any onChange client scripts for that field even though the value does not change.
Steps to Reproduce
- Create a new Catalog item
- Create a variable of type checkbox named field1
- Create a Variable of type Yes/No named field2
- Create an onChange client script for when field1 (the checkbox) changes with this line of code added.
- Create an OnChange client script for when field2 change with this line added.
- g_form.addErrorMessage("Field 2 has changed");
Try the item and notice when the box is checked, the error message is displayed. Therefore, onChange client scripts for the field are being triggered, when doing a g_form.clearValue.
This is a regression in Jakarta and does not happen in Istanbul.
As a workaround on early Jakarta instances, use Include None under Type Specification for the variable of type Yes|No or Select Box where this issue occurs.
Related Problem: PRB1194586