- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 11:38 AM
Hi,
I call the ui page with this client script:
Both the background and the popup window become dark, and the button in popup doesn't work.
What could be the problem?
UI Page HTML code:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 07:09 PM
The CSS for the modal might be conflicting with the default styles of the GlideModal. The background-color: rgba(0, 0, 0, 0.4); in your .modal class is making the entire background dark.
use this in html for the css
<head>
<style>
.modal-content {
background-color: #fefefe;
margin: 15% auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
border-radius: 15px;
}
</style>
</head>
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 07:09 PM
The CSS for the modal might be conflicting with the default styles of the GlideModal. The background-color: rgba(0, 0, 0, 0.4); in your .modal class is making the entire background dark.
use this in html for the css
<head>
<style>
.modal-content {
background-color: #fefefe;
margin: 15% auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
border-radius: 15px;
}
</style>
</head>
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 09:34 PM
Hi @DoDo labs___
You can modify the below code :-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var gdw = new GlideModal('TESZT');
gdw.setTitle('Change Checklist');
gdw.setSize(400);
gdw.render(); // Load the modal
}
UI Page :-
<html>
<head>
<style>
.modal-content {
background-color: #fefefe;
margin: 15% auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
border-radius: 15px;
}
</style>
</head>
<body>
<div class="modal-content">
<h2>Test</h2>
<button onclick="myFunction2()">Add Item</button>
</div>
<script>
function myFunction2() {
alert('Add Item button clicked!');
}
</script>
</body>
</html>
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:37 AM
Thank you all for your help!