Hide Show Annotation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 03:57 PM
Hello,
I was trying to HIDE / SHOW an Annotation, if particular business condition is met.
Unfortunately, after trying this via CLIENT SCRIPT and UI POLICY and by also following steps from different forums, it still didn't work.
Here's my Annotation HTML script (FORM Layout / Form Design) Excerpt ONLY:
<divid id="anno1" style = "line-height:2; font-size:13.4px;">Attachment Required</divid>
In CLIENT SCRIPT and UI POLICY Excerpt ONLY:
var statusx = g_form.getValue('status');
if (statusx == 'Draft'){
document.getElementById("anno1").parentNode.style.display="block";
}
else {
document.getElementById("anno1").parentNode.style.display="none";
}
}
The Browser DEV Tool is giving me this error -
Uncaught TypeError: Cannot read property 'getElementById' of null
Am I missing something here?
Appreciate your time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 05:44 PM
Hi,
Your script looks good, only change you need to do is on the form layout in the Annotation script where you are defining the ID. It should be as mentioned below:
<div id="anno1" style = "line-height:2; font-size:13.4px;">Attachment Required</div>
You have written id twice in your script above in the form layout, it should be just the div tag having a ID defined for referencing while trying to hide or show the Annotation.
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2017 12:24 AM
Thanks Shloke. Unfortunately, that didn't work either. I also used span, div, divid - which I got from one of the forums.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2017 05:13 AM
Hi,
Can you post a screenshot of the annotation you configured in the form layout view?
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2017 05:44 AM