How to show a pop-up(contain URL or image) when user check select-box in a catalog form

Siddhartha
Tera Contributor

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

Muhammad Khan
Mega Sage
Mega Sage

Create onChange catalog client script on your variable (I have used checkbox variable). See the below image for reference.

MuhammadKhan_0-1668084656576.png

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

}