Hide Annotation with Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2009 12:46 PM
Is it possible to hide an Annotation with a client script the way we can make fields visible/invisible?
I'd like to be able to hide an Annotation along with a set of fields for a specific set of users.
As a workaround, I suppose I could create an actual field with a colored label, but that seems like brute force.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2016 11:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2016 11:31 AM
Hi,
I got the same issue today. I tried using <span> instead of <div>, and it works. I don't see a gap anymore. Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2016 03:55 AM
Hi Veena,
Could you please elaborate on using of SPAN tag. I too tried to use it.
But the box just got reduced rather than getting completely disappeared.
Below is what I have written :
Annotation desc :
<span id="div1" >
Testing Annotation
</span>
Client script :
function onLoad() {
//Type appropriate comment here, and begin script below
var stageTest = g_form.getValue('u_stage');
if (stageTest == 0)
{
div1.style.display = 'false';
}
}
Regards,
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2016 09:50 AM
Hi Sunil,
This is what worked for me: For the annotation, I named it as- <span id="anno1">This is a heading</span>
Then in a client script:
document.getElementById("anno1").parentNode.style.display="none"; //This is to hide the annotation
document.getElementById("anno1").parentNode.style.display="block"; //This is to display the annotation
You'll have to write both onChange and onLoad client scripts because when you write only onChange, they don't work when the form is saved and reloaded.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2016 01:09 AM
How are you currently hiding the annotation area?
Did you use
g_form.setVisible('field_name_here', false);
or
g_form.setDisplay('field_name_here', false);
