Label over checkboxes

tgcorbin
Mega Contributor

Hello,

I am trying to create a label over some check boxes on a catalog item. I want it to look like the employee information on the left, where it has a line underneath it. When I put the label over the check boxes, the line goes away and it merges with the checkbox list. How can I fix this?

123.PNG

Thanks,

4 REPLIES 4

shivam_singhal
ServiceNow Employee
ServiceNow Employee

Hi Trevor,



You are adding checkboxes after label it means that label is for those checkboxes and because of that we are putting label and checkbox in a container and to reflect that particular label is related with those checkboxes we do not provide any horizontal line between them.



Better option is to add one more label just above your current label, that will draw a line.



like:


Screen Shot 2017-06-23 at 7.57.29 PM.png


Mark your feedback( Like or Helpful or Correct) as per the impact of my response. Cheers!



Shivam


Is there a way to completely just remove the label on the check boxes? If I don't put a label above them, the the text 'other' appears above them. Is there a way to remove that?


Hi Trevor,



Please check the below link



https://www.servicenowguru.com/system-definition/multiple-checkbox-variables-service-catalog-surveys...



Reponse from Mark



To do that you would need to create your own 'Label' variable to override the standard 'Options' variable as I've described in this article. Once you've done that, you need to get the sys_id of the 'Label' variable and put it in code like this to hide the label. I'm not sure if this will work for survey labels but it should work there as well.


$('label_IO:afd0ab042f306100aa45f67b91a189e4').hide();



Please mark this response as correct or helpful if it assisted you with your question.

shivam_singhal
ServiceNow Employee
ServiceNow Employee

Trevor,  



DOM manipulation is a way of which is being provided


https://www.servicenowguru.com/system-definition/multiple-checkbox-variables-service-catalog-surveys...



However, it will cause problems like if you mark your checkbox as 'mandatory to select' because you had hidden the label of the checkbox you will not get the Mandatory star.



Here, things depend on your use case, choose available options wisely.



Mark your feedback( Like or Helpful or Correct) as per the impact of my response. Cheers!


Shivam