The CreatorCon Call for Content is officially open! Get started here.

How to remove title(instance says) from the confirm box

Tabassum Sulta1
Kilo Contributor

How can we remove the highlighted message from the confirm box?

I have used confirm function for the pop up but want remove the instance says(highlighted) message here attached in screenshot.

function Test(){

var ans = confirm("This is the confirmation msg click ok");
if (ans == false) {

return false();

        }

}

find_real_file.png

1 ACCEPTED SOLUTION

Willem
Giga Sage
Giga Sage

You can create a Confirmation Modal:

var dialog = new GlideModal('glide_modal_confirm', true, 300);
dialog.setTitle(new GwtMessage().getMessage('Confirmation'));
dialog.setPreference('body', new GwtMessage().format("Your message"));
dialog.setPreference('focusTrap', true);
dialog.setPreference('onPromptComplete', doComplete);
dialog.setPreference('onPromptCancel', doCancel);
dialog.render();

function doComplete() {
    callback(true);
}

function doCancel() {
    callback(false);
}

 

No need to create a UI Page.

https://gist.github.com/icerge/4c29728c4a8cf0c04ef8bc8cf14519c1

View solution in original post

7 REPLIES 7

Kieran Anson
Kilo Patron

The window.confirm() method functionality is a native modal dialog so it'll depend on the browser. As you can see, firefox renders the confirm modal differently:

find_real_file.png

You'll likely need to go down the route of a custom GlideDialogModal.

find_real_file.png

Does using sp model will work here, in UI Action as I don't want to use UI pages?

Sadly not, native ui required Jelly

Willem
Giga Sage
Giga Sage

You can create a Confirmation Modal:

var dialog = new GlideModal('glide_modal_confirm', true, 300);
dialog.setTitle(new GwtMessage().getMessage('Confirmation'));
dialog.setPreference('body', new GwtMessage().format("Your message"));
dialog.setPreference('focusTrap', true);
dialog.setPreference('onPromptComplete', doComplete);
dialog.setPreference('onPromptCancel', doCancel);
dialog.render();

function doComplete() {
    callback(true);
}

function doCancel() {
    callback(false);
}

 

No need to create a UI Page.

https://gist.github.com/icerge/4c29728c4a8cf0c04ef8bc8cf14519c1