spModal code assist

taofeek93
Tera Contributor

Hi all,

 

I'd appreciate your help on this code. It is a popup modal that appears onLoad; the expectation is to show three buttons, two choices + cancel.  

 

The model is popping up, but the buttons aren't responding by redirecting me to the right link. Also I'd like to remove the 'x' button so the user is forced to interact with the modal.

 

Thank you

 

 

function onLoad() {
    if (typeof spModal != 'undefined') {
        spModal.open({
            title: "Custom Modal Title",
            message: "This is a custom modal content.",
            buttons: [
                { label: "Cancel", cancel: true, color: "danger" },
                { label: "Alternative App Inquiry", color: "success", cancel: true },
                { label: "Create Tech Eval", color: "primary" }
            ]
        }).then(function (confirmed) {
            if (confirmed) {
                if (confirmed === 'Create Tech Eval') {
                    // Redirect to Google's website when "Create Tech Eval" is clicked
                    window.location.href = "https://www.google.com";
                } else if (confirmed === 'Alternative App Inquiry') {
					window.location.href = "https://www.yahoo.com";
                } else if (confirmed === 'cancel') {
                                        window.location.href = "https://www.apple.com";
            }
        });
    }
}

 

 

 

 

0 REPLIES 0