- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2020 11:50 PM
Hi All,
I need to disable a ui page which is triggered but based on certain condition.
Points to consider:
1. Alert page is displayed when user clicks 'approve n send' and expected review time is not met.
2. In my current setup, when user cancel on Alert page, validation page reloads.
3.When ui page 2 - 'Alert' is displayed, ui page 1 'validation' should be disabled.
Reason to do this is at the moment the fields are editable even if page 2 loads.
My question - How can we disable the validation page when alert page loads ?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 03:18 AM
Update on my question:
Solution:
In client script have passed id's for each field ie to,cc,bcc,subject and body and button to make the fields readonly.
var ok = document.getElementById("ok_button");
ok.style.display = "none";
var cncl = document.getElementById("cancel_button");
cncl.style.display = "none";
var to_readonly = document.getElementById("TO_unchecked");
to_readonly.disabled = 'true';
var cc_readonly = document.getElementById("CC_unchecked");
cc_readonly.disabled = 'true';
var bcc_readonly = document.getElementById("BCC_unchecked");
bcc_readonly.disabled = 'true';
var subjecy_readonly = document.getElementById("subject");
subjecy_readonly.disabled = 'true';
var body_readonly = document.getElementById("Body");
body_readonly.disabled = 'true';
The ids are defined in html part of 1st ui page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2020 10:03 PM
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2020 10:17 PM
tried this as well..but it's not working..
document.getElementById("emailForm").setAttribute("readonly","true");
emailform is the id of the form where html content of page 1 is defined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 10:48 PM
You can use JQuery, but instead of common selector $ you have to use $j.
So the solution for question is:
$j("#emailForm").attr("readonly", true");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 10:58 PM
Hi Maik,
tried this now but it's not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 11:26 PM
I'm afraid without deeper insights into your devloped artifacts and an extensive debugging session it cannot help further.
By the way: Why did you load a second UI Page? Maybe that causes your problems. I think using a GlideModal dialog would be the better approach.
For more information see that community question: https://community.servicenow.com/community?id=community_question&sys_id=34574369db1cdbc01dcaf3231f96...