How to show a pop-up(contain URL or image) when user check select-box in a catalog form
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2022 03:14 AM
Hey developers,
We have a requirement where we need to add a pop-up window to show URL or image, when user checks the select-box in a catalog form.
Kindly suggest.
Thanks in advance.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2022 04:52 AM
Create onChange catalog client script on your variable (I have used checkbox variable). See the below image for reference.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '' || newValue == 'false') {
return;
}
//Type appropriate comment here, and begin script below
var html = '<a href="https://www.google.com" target="_blank"><img src="aes_resources_data.svg"/></a><a href="https://www.google.com" target="_blank">Google</a>';
if (window === null) {
spModal.open({
title: 'Testing',
message: html
});
} else {
var gm = new GlideModal();
gm.setTitle('Testing');
gm.renderWithContent(html);
}
}