Multiple checkbox selection embedded HTML form

Greetings,

I have a user task which has a form where there is a multiple selection checkbox, but when I look at Camunda documentation, it says that checkboxes only support Boolean type input. I want to be able to select more than one option in the checkbox list.

How can I go about it?

Hi @Kirwana_Fredrick,

Using angularjs, below is a sample for a start html form

  1. a new angularjs object ‘checkModel’ with 3 boolean attributes has been created “assuming that 3 options are available”.

  2. on form submission (https://docs.camunda.org/manual/latest/reference/embedded-forms/lifecycle/#event-listeners), a new process variable has been created named ‘checkModel’ with the json value of ‘checkModel’ object assigned to it.

  3. Buttons directive has been used as input control from where user can select as many options as he wants (http://angular-ui.github.io/bootstrap/versioned-docs/0.12.0/#/buttons)

    <script cam-script type="text/form-script">
	
	inject(['$scope', function($scope) {
		$scope.checkModel = {
			left: false,
			middle: true,
			right: false
		};
		
		camForm.on('submit', function (evt) {

			// declare a 'json' variable 'checkModel'
			variableManager.createVariable({
			  name: 'checkModel',
			  type: 'json',
			  value: $scope.checkModel
			});             		
		});
	}]);
    
	</script>
	
	<h4>Checkbox</h4>
    <pre>{{checkModel}}</pre>
    <div class="btn-group">
        <label class="btn btn-primary" ng-model="checkModel.left" btn-checkbox>Left</label>
        <label class="btn btn-primary" ng-model="checkModel.middle" btn-checkbox>Middle</label>
        <label class="btn btn-primary" ng-model="checkModel.right" btn-checkbox>Right</label>
    </div>
</form>