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

If you remove the "setTitle" it removes the title:

find_real_file.png

Willem
Giga Sage
Giga Sage

Hi Tabassum,

Hope you are doing well.

Is your question resolved? Or do we need to follow-up on this?

Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

Kind regards,

Willem

pavana1
Tera Contributor

Hi Willem,

 

Onchange script for my check box

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() {
g_scratchpad._action_confirmed = true;
callback(true);
}

function doCancel() {

callback(false);

}

I have tried above code for my catalog and from portal getting error like "There is a JavaScript error in your browser console"  in that screen  Control+shift+J 

(g_env) [SCRIPT:EXEC] Error while running Client Script "Cox_OwnersApproval request": ReferenceError: GlideModal is not defined

So how to solve this problem.

Please help me out .

Thanks & Regards,

Pavana