Skip to main content

The user complains that when they click on negative space (white space) on the form, sometimes it happens to be within a choice checkbox area and accidentally one of the checkboxes is checked or unchecked, and sometimes they don't notice (eek).  Is there any way to configure it so that only clicking on the checkbox text or checkbox itself changes the Choice controls value?

Good Day ElenaB


 


I noticed that between the three different checkbox controls, only the choice checkbox reprents this behaviour, the checkbox and the checkbox list does not have this behavior. With the above mentioned the behaviour  is considered as per design when it comes to the Choice Control, you can however log a feature request on the ideas page "https://ideas.k2.com/ideas/new" requesting that the controls width be adjustable, this would most defenintly resolve the issue and allow the control to only be selectable when clicking on the text of the control OR when clicking on the checkbox of the control.


 


Alternatively there are two solution that you can use:


Solution 1: Use the Checkbox list control instead of the Choice Checkbox list control. The Out of th Box Checkbox list control does not display this behaviour.


 


Solution 2: Inject some custom javascript code into an literal data label's text field, the code should set the width of the Choice controls controlwrapper class to a minimum of 75px. I tested the below code snippet on a single view with a Choice control set to a checkbox, it provide the required behaviour as expected.


<script>document.getElementsByClassName("controlWrapper")[0].style.width="75px";</script>

Note: Please bear in mind that if you have more than one control on your viewform that has a class called "controlWrapper" then you would need to identify the index of the one you want to make the change to, then specify that index in the "[0]" section of the code snippet.


 


*Both these solutions will allow the control to only be selectable when clicking on the text of the control OR when clicking on the checkbox of the control. Clicking on the blank section next to the control will not toggle the control.


 


Should you feel that this post is of use and or an accurate solution to the raised question, I kindly encourage you to mark it as such using the 'Mark as Solution', 'Kudo' andor ‘Me Too’ options.


 


Kind Regards


Raymond


Reply