How to create a user input pop up window?

omsa1
Kilo Guru

Hi All,

I have a requirement when a HRcase reopened,   user have to enter reason for reopening the case. When user click on "Reopen case" UI action it should pop up a window for user to enter reason for reopening (should have an "ok" or "cancel" button in that window) and when user click ok it should check if the input box is empty and add that comment into Comment field , change the case state to work in progress and save. if user click cancel then it should return to current page. Comment shouldn't be empty.

21 REPLIES 21

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sarasaamani,



Have a prompt box which prompts to user with an input field



var reason = prompt("Enter the reason for reopening the case");


if (reason){


// value is present in reason


}


else{


// again have prompt box


}



the reason variable holds the value in prompt box.   You can then populate the reason in comment field.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,



Thanks for your reply, can i use this in Record producer?


Hi Sarasaamani,



Yes you can call this from any client side script such as Catalog client script, Client scripts etc



Regards


Ankur


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur Bawiskar,



Can we able to Display Prompt Box [ Dialog Box ] with message 'Thanks for Visit this Article"       when we click YES or NO buttons in KB Article??



it's became challenging to me, could you please help me on this.



find_real_file.png