Show/Hide Annotation UI Policy not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2017 03:53 PM
Hi Experts,
I have two annotations on a form and I'm trying to show/hide only ONE of them based on a particular answer. I've tried adding an id to my annotation and then using the UI Policy script conditions to show/hide the annotation, but it's not working. I gave my annotation an id = "other" and I created this UI Policy:
Execute if true:
document.getElementById("other").parentNode.style.display="block";
Execute if false:
document.getElementById("other").parentNode.style.display="none";
When I run the form, both annotations are gone and when I change my answer to that particular field to Yes, I get this error:
onChange script error: TypeError: Cannot read property 'getElementById' of null function (){var o=i(m,arguments);return l.apply(n,o)}
What am I doing wrong here?
Additionally, when I add <div id="other"> to my annotation, it adds another box and an input onto the form...
When looking in the console, it adds an additional div and an input:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2019 04:43 PM
Haven't tried but I see a script on a UI Policy out of box. Looks hard-coded, but maybe will work for you:
function onCondition() {
if(document.getElementById('group_tip'))
$j('#group_tip').parents('.annotation-wrapper').css("display", "block");
}
update group_tip to fieldname in 2 places.
"block" shows, change to "none" to not show.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2019 06:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2019 04:43 AM
I am trying to hide an annotation (one of many) in an on Change client script.
1) I place the above code in my script but it does not work -- I don't see any statement to identify which annotation i want to hide
2) I have multiple annotations and want to hide only 1 in my client script, how do i identify which annotation i am manipulating?