- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 12:15 AM - edited 05-06-2024 12:18 AM
Is there any way/method to get element of form label in Client script, i am trying to "setStyle" of label
// Working for field
var requestorField = g_form.getElement('sys_display.' + g_form.getTableName() + '.u_authorized_requestor_s_full_name');
// Not working for form label
var requestorLabel = g_form.getElement('label.' + g_form.getTableName() + '.u_authorized_requestor_s_full_name');
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 12:30 AM
Basically it is absolutely not recommended to do this kind of DOM manipulation!
Take the following example to see how to change the label color to red for the "Close code" field on a incident form:
function onLoad() {
var objLabel = g_form.getLabel('incident.close_code');
objLabel.style.color = 'red';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 12:28 AM
Please check below link should help you
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 12:30 AM
Basically it is absolutely not recommended to do this kind of DOM manipulation!
Take the following example to see how to change the label color to red for the "Close code" field on a incident form:
function onLoad() {
var objLabel = g_form.getLabel('incident.close_code');
objLabel.style.color = 'red';
}