how to display simple alert pop up mesage with ok button on record producer.

Shilpi Sharma2
Tera Contributor

HI all,

I want to display a pop up message with ok  button if any feedback is pending while raising new incident. Please help

11 REPLIES 11

I want to display pop up on Page load with ok and cancel button on record producer

Apeksha Joshi
Kilo Guru

Hi shilpi ,

try on submit catalog client script :

function onSubmit() {
   //Type appropriate comment here, and begin script below

 if(condition if any feedback pending)

{
   alert("alert message");

}
}

Mark my answer correct helpful based on impact .

Regards,

Apeksha

Kunal Varkhede
Tera Guru

Hi,

 

To achieve your use case use Confirm Box.

You can simply write OnLoad() client script if you want confirm box on form load and write some condition in it as per your requirement. You can also use this in Onchange() and OnSubmit() Client script. Based on you action (Ok or Cancel)in confirm box it would go further.

Refer this below code i have done this.  

function onLoad() 
var confirm_box = confirm("Confirm Box"); //this will give you a confirm box 
if(confirm_box == true)//if we select Ok in confirm box
{
 //do some stuff here
g_form.setDiasplay('field_name','boolean value');
g_form.setMandatory('field_name','boolean value');
}
else
{
//do some stuff here
}
}

And you can also use this based on your condition refer below link this it will help you more.//www.servicenowguru.com/scripting/client-scripts-scripting/javascript-popup-boxes-servicenow/

 

Please Mark Correct Answer if it help you in any way.

Thanks and Regards,

Kunal.

any update on this.

if you get your issue resolve then marking this thread as correct so that this thread useful to others.

 

Thanks,

Kunal

for cancel i need to keep old value for that its not working