Mandatory on Checkboxes in Service Portal

qqj5004
Kilo Contributor

Hi all

I am having an issue with mandatory checkbox. In Jarkata we have format below

Label (mandatory if no checkbox is selected)

checkbox1

checkbox2

checkbox3

In Service Portal, I can't make the same feature happen. I had considered the onsubmit client script, but on users's perspective, it is not a good practice for user experience because every time they submit a form, alert pop up. What if there is case checkbox within checkbox, like checkboxes show based on first checkbox list.

Is there any solution on this issue? Please help.  

Thank you

12 REPLIES 12

ChrisBurks
Mega Sage

Hi Qili,



If I understand the issue correctly, the feature is that when no checkboxes are checked a label displays stating that a selection is mandatory. Is that correct?



Also, it may help to post how you implemented the feature. For example is it a UI policy or a Client Script that performs the check? If it has a script could the script be posted? Are there any errors when rendered in the Service Portal view?



Those things could help troubleshoot the issue of why it doesn't work in Service Portal.


checkbox1.jpg


I made one of the check mandatory, in jakarta, the app will be mandatory if one of the checkbox is mandatory. However in Service portal it only made the checkbox mandatory instead of the label



I tried UI policy,   but the outcome on Service portal is not what I expected.


checkbox UI policy.jpg



Service portal outcome with UI Policy


checkbox.jpg


I want the red asterisk on next to the Application, when one of the checkbox is checked, the asterisk grey out.




Right now we have the onSubmit client script to prevent user submit without checking the checkbox, which we don't want to use it.


onsubmit.jpg


I'm not sure what's in the rest of the function forceMandatoryCheckboxes as the screenshot didn't capture all of it. But from what I see the script should work.


You didn't mention if you've checked for errors doing an "Inspect Element", however one quick thing to check is on the catalog client script form is the UI Type set to "All" so that it runs both for desktop and mobile?   Service Portal is considered mobile.


I don't want to use the client script, because it does not contain a red asterisk next to the field name.