anchor.diff:                      }
                   }
   
  -                if(ALL_ATTRIBUTES_MANDATORY){
  +                if (ALL_ATTRIBUTES_MANDATORY) {
   
                       var selectedAttributes = container.jstree(true).get_selected();
  -                    var allSelected = compareArrays(allAttributes,selectedAttributes) ? true : false;
  -
  -                    if(!allSelected){
  +                    var allSelected = compareArrays(allAttributes, selectedAttributes) ? true : false;
  +
  +                    if (!allSelected) {
                           $("#attribute_selection_validation").modal();
                           return false;
                       }
  
positive.code:                 <%
                  if (hasPurposes) {
                  %>
                      var self = this;
                      e.preventDefault();
                      var recipt = addReciptInformation(container);
                      $('<input />').attr('type', 'hidden')
                          .attr('name', "consent")
                          .attr('value', JSON.stringify(recipt))
                          .appendTo('#register');
                      self.submit();
                  <%
                  }
                  %>
  
negative.code: 
              container = $("#html1").jstree({
                  plugins: ["table", "sort", "checkbox", "actions", "wholerow"],
                  checkbox: {"keep_selected_style": false},
              });
  
          }
  
          function addReciptInformation(container) {
              // var oldReceipt = receiptData.receipts;
              var newReceipt = {};
              var services = [];
              var service = {};
  
              var selectedNodes = container.jstree(true).get_selected('full', true);
              var undeterminedNodes = container.jstree(true).get_undetermined('full', true);
  
              if (!selectedNodes || selectedNodes.length < 1) {
                  //revokeReceipt(oldReceipt.consentReceiptID);
                  return;
              }
              selectedNodes = selectedNodes.concat(undeterminedNodes);
              var relationshipTree = unflatten(selectedNodes); //Build relationship tree
              var purposes = relationshipTree[0].children;
              var newPurposes = [];
  
              for (var i = 0; i < purposes.length; i++) {
                  var purpose = purposes[i];
                  var newPurpose = {};
                  newPurpose["purposeId"] = purpose.li_attr.purposeid;
                  //newPurpose = oldPurpose[0];
                  newPurpose['piiCategory'] = [];
                  newPurpose['purposeCategoryId'] = [1];
  
                  var piiCategory = [];
                  var categories = purpose.children;
                  for (var j = 0; j < categories.length; j++) {
                      var category = categories[j];
                      var c = {};
                      c['piiCategoryId'] = category.li_attr.piicategoryid;
                      piiCategory.push(c);
                  }
                  newPurpose['piiCategory'] = piiCategory;
  