Dom manupaulation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 10:20 PM
Hello All,
We have one catalog client script which uses dom manipulation.
function onSubmit() {
//var checkValueOfField = g_form.getValue('u_select_user_profile');
// check CT or ITP access is contained within the variable
//if (checkValueOfField.indexOf('d03dd507db1d3f40034de0a1ca96196c')>=0 || checkValueOfField.indexOf('1a3dd507db1d3f40034de0a1ca96199e')>=0){
//run attachment check
if (g_form.getValue('type_request') == "inquiry") {
if ((this.document.getElementsByClassName('get-attachment').length == 0)) {
// no attachment uploaded, we alert user and dont submit request
alert('Attachment (screenshot of error) is mandatory for incident submission.');
return false;
}
}
}
It is not working as excepted. We identified that Dom manipulation is not working on current ServiceNow version .
:

It is not working as excepted. We identified that Dom manipulation is not working on current ServiceNow version .
:
Based on the below link:
We made isolated script to false and created the property which mentioned in the article but the issue remains same.
Please do need full help.
Regards,
sravya.A
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 12:18 AM
You can't access dom by the key word 'document' directly as this code snapt revoled in js sandbox, but can get access dom by this methoed
var form_field_name='';//like number or state anything else;
var rootEle = g_form.getElement(form_field_name).getRootNode();// DOM;