How to Display POP-UP Box [ Message Box] when we click on Button

Kishore8
Kilo Guru

Hi,

if i clicked   YES or NO button in KB ARTICLE     then immediately       display POP-UP box(message box) with message- Thanks for Visiting

OR    

Make Comments box mandatory .

for this i tried to check UI Macro's(it is in readonly)   , UI pages   but   i am unable to understand where need to do changes

find_real_file.png

1 ACCEPTED SOLUTION

Hi Kishore,



yes this should be possible.


just as on click of yes you added an alert same can be done for No as well.


you need to add if else condition in the script.


I have tested and it is working fine.



Modify the code as per below screenshot.



ui macro knowledge.JPG



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

View solution in original post

11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Kishore,



Did you add the button Helpful? Yes No from your side or it is out of box.



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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Kishore,



I did find the Helpful message is out of box and here is the way you can add an alert on click of Yes.


Go to UI Macro -> search for XML contains Helpful? you should find this ui macro 'kb_view_ratings'.



within this UI macro you will see that a function feedback is being called on click of Yes search that and update as per below screenshot:



ui macro-know.JPG



Test it now.


Working fine screenshot below:



know-working.JPG


Remember that this will be a global change since this ui macro is applicable for all records.



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 Bawiskar,




It was really very challenging for me.



Thanks , You are really great Ankur!


your reply is very helpful for me.


I am Really very glad with your reply. Ankur!





In the same way,   can we make comments box mandatory when we click on YES, is it possible?


Hi Kishore,



I think that would be somewhat difficult because it is not some field but part of UI macro code using HTML.


But still I will check on that.



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