Make readonly/Disable ui page

Rj27
Mega Guru

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 ?

find_real_file.png

1 ACCEPTED SOLUTION

Rj27
Mega Guru

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.

View solution in original post

12 REPLIES 12

Rj27
Mega Guru

.

Rj27
Mega Guru

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.

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");

Hi Maik,

tried this now but it's not working

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...