How to make "details" as mandatory when Helpful is selected as "NO" in knowledge article

sandeep24
Tera Guru

How to make "details" as mandatory when Helpful is selected as "NO" in knowledge article

 

Steps to reproduce.

1. Navigate to https://dev*****.service-now.com/kb

2. Open any of the article

3. Click on Helpful as "NO". Popup appear

4. How to make "Details" mandatory

find_real_file.png

1 ACCEPTED SOLUTION

Hi Sandeep,

Thanks for providing the details. The feedback popup is coming from the ng-template "kb-feedback-task-modal" attached to the widget - "kb-article-content".

To make details mandatory - you need to modify the method - c.submitFeedbackTask in the widget - "kb-article-content". If you see the method - "submitFeedbackTask", there is already code to make the reason mandatory. Implement the same for details also.

Thanks

View solution in original post

9 REPLIES 9

Chander Bhusha1
Tera Guru

Hi sandeep2729,

There are two ways to do this. One is to make the submit button disabled and only avialable if the comments is filled in.

And do you wan't it to be applicable for No Thanks button also or is it only for Submit button.

 

Thanks,

CB

amaiyavinash
Tera Contributor

See the screenshot, and make the changes it made the save button disable when the details are not filled.

Hi Amaiyavinash,

I tried as per your pic but it didn't work for me. Can you help me in making details mandetary.

Thanks,

Manohar

SNow35
Giga Guru

Hello,

Could you please let me know if you were able to make the details mandatory if yes can you please provide the script used.

 

Thanks in advance.

Shubham3
Kilo Guru

Hi ,

you can achieve this by updating the  Client scripting of Knowledge Article Content widget.you need to create clone of this widget and use that in your kb_article_view page.

i had the requirement to make details mandatory if other is selected. you can modify the condition accordingly.

 

c.submitFeedbackTask = function() {

if (c.data.reason == 4 && c.data.details == '') {
c.flagMessage = "${Please provide the mandatory details}";
$("#detailsComment").focus();
return false;
} else {
c.submitted = true;
c.closePopup();
}
}


Please, if this answer is relevant for you, please mark it as correct and helpful.

Thanks,

Shubham