Note: this is an older post, DOM manipulation is not recommended in ServiceNow
---
options:
- use annotation via configure form layout > * annotations
- use g_form.showFieldMsg > use 4th boolean parameter and set to false to stop the form auto-scrolling to the field
- use g_form.addDecoration
here's a rather clunky way of editing the change_request.test_plan hint:
var el = gel("label.change_request.test_plan");
//var el = gel("status.change_request.test_plan");
alert (el.innerHTML);
document.getElementById('status.change_request.test_plan').setAttribute('title', 'BLAHBLAH');
document.getElementById('status.change_request.test_plan').setAttribute('aria-label', 'BLAHBLAH');
alert(el.innerHTML);
var elements = el.getElementsByTagName('span');
alert('LEN: ' + elements.length);
for(var i = 0; i < elements.length; i ++) {
if(elements[i].className === 'label-text') {
alert('found!');
alert(elements[i]);
elements[i].setAttribute('title', 'BLAHBLAH');
}
}
alert(el.innerHTML);
Comments
Post a Comment