Custom complete button

Hi,

I want to remove the save and complete button with the help of this post:
https://forum.camunda.io/t/remove-save-button-in-tasklist/41942/3

After that I want to create a custom complete button. Does anyone have an example how to create a custom complete button, that is only active when all required fields are there?

Thanks in advance.

Hi,

You can use Angular’s ng-disableddirective. Consider the following example:

<form name="myCustomForm">
  <script cam-script type="text/form-script">
        $scope.options.hideCompleteButton = true;
  </script>

  <label for="customerId">Customer Id:</label>
  <input type="text" id="customerId" name="customerId"
         cam-variable-name="CUSTOMER_ID"
         cam-variable-type="String">

  <label for="customerRevenue">Customer Revenue:</label>
  <input name="customerRevenue" type="String" id="customerRevenue" required
         cam-variable-name="CUSTOMER_REVENUE"
         cam-variable-type="Double">

  <button type="submit" ng-disabled="!myCustomForm.$valid" ng-click="complete()">Submit</button>
</form>

The submit button is only enabled, if there is valid double value in the required field “customerRevenue”.

3 Likes

Wow thank you, that´s great :slight_smile: