If a field is removed from the form, but the Activity (filtered) is added to the form, the checkboxes for the activity may be mistaken for the field. This will cause g_form.getValue() to return on rather than the expected null or empty string value.
Steps to reproduce:
- Go to the incident form.
- Remove the Priority field from the form and add the Activity (filtered) field to the form.
- Customize the activity field to include the priority field in its reports.
- Add an onChange (Field name: Short description) client script to the incident table with the code: alert(g_form.getValue('priority'));
- Go to an existing incident. Click the >> in the Activity header and make sure that there is a Priority checkbox in the header.
- Modify the Short description field. Click somewhere else on the page and see if an alert box is opened with the value on. It should have been an empty alert box because the priority field is not on the form.
Use the script: g_form.hasField() before using g_form.getValue()