Encompass Form Builder Checkboxes as Radio buttons

In Encompass, you can use checkboxes as radio buttons by creating a custom script that ensures only one checkbox can be selected at a time. Here’s how to do it:

  1. Open the Custom Form Designer in Encompass and create a form that includes multiple checkboxes that you want to use as radio buttons.
  2. Create a custom script that will ensure only one checkbox can be selected at a time. To do this, you’ll need to use JavaScript code that sets the “checked” property of all the checkboxes to false except for the one that was just clicked.

Here’s an example of how the custom script might look:

function checkboxAsRadioButton(checkbox) {
var checkboxes = document.getElementsByName(checkbox.name);
for (var i=0; i<checkboxes.length; i++) {
checkboxes[i].checked = false;
}
checkbox.checked = true;
}

This code takes the name of the checkbox group as a parameter and sets the “checked” property of all the checkboxes in the group to false except for the one that was just clicked.

  1. Apply the custom script to each of the checkboxes in the group. To do this, select each checkbox in turn and add an “On Click” event handler that calls the custom script with the checkbox as a parameter.

Here’s an example of how the “On Click” event handler might look:

checkboxAsRadioButton(this);

This code calls the custom script with the current checkbox as a parameter.

  1. Save and publish the form. Once you’ve applied the custom script to all the checkboxes in the group, save and publish the form. When the form is opened in Encompass, the checkboxes will function as radio buttons, allowing only one option to be selected at a time.

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.