- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2020 02:00 PM
I have a field on a form which I want to verify as being hidden/ empty. The field would be hidden if it is empty as that part is already built in. I want to find out if the field is visible or if the field is empty on the form in a client script. Please help. Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2020 03:28 PM
You could do a check like this.
if (g_form.isVisible('field') || g_form.getValue('field') != '') {
// check if the field is visible or has a value
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2020 02:12 PM
This community post may help: check visibility of variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2020 02:55 PM
On a form in the back-end you can use
g_form.isVisible("fieldName");
It will return true if the field is visible.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2020 03:28 PM
You could do a check like this.
if (g_form.isVisible('field') || g_form.getValue('field') != '') {
// check if the field is visible or has a value
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 07:17 AM
I am not sure why, but for me it works only when I do:
var priElement = g_form.getGlideUIElement('priority');
var priControl = g_form.getControl('priority');
if (g_form.isVisible(priElement, priControl))
g_form.setMandatory('priority', true);