$(document).ready(function(){
  console.log("I am here");
  var
    attachmentsCount = 0,
    maxAttachments = 10,
    setAddMoreFilesButtonState,
    textAreaValidationReq = window.Diaphanum.appConfig.textAreaValidationReq;

  setAddMoreFilesButtonState = function(numberOfFiles){
    var
      $oneMoreFileButton = $("#addOneMoreFile");

    if(numberOfFiles >= maxAttachments){
      $oneMoreFileButton
        .attr("disabled", "disabled")
        .html($("#maxFilesReachedTemplate").html());
    } else {
      $oneMoreFileButton
        .removeAttr("disabled")
        .html($("#addOneMoreFileTemplate").html());
    }
  };

  $(".projectForm")
    .on("click", "#addMemberButton", function(){
      var newTeamMemberHtml = $("#newTeamMemberTemplate").html();
      // use underscore if any placeholders
      $(newTeamMemberHtml).insertBefore("#addMemberControl");
    })
    .on("click", ".removeTeamMember", function(){
      $(this).parent().remove();
    })
    .on("click", "#addOneMoreFile", function(){
      var newAttachmentHtml = $("#newAttachmentTemplate").html();
      // use underscore if any placeholders
      $(newAttachmentHtml).insertBefore("#addOneMoreButtonContainer");
      attachmentsCount += 1;
      setAddMoreFilesButtonState(attachmentsCount);
    })
    .on("click", ".removeAttachment", function(){
      $(this).parent().remove();
      attachmentsCount -= 1;
      setAddMoreFilesButtonState(attachmentsCount);
    });

  $(".projectForm").validate({
    // TODO: Fix the bug here
    errorPlacement: function(error, element){
      var elementClasses = element.attr("class").split(" ");

      if(_.contains(elementClasses , "projectTeam")){
        console.log(error, element);
        $("#membersError")
          .html("")
          .append(error);
      }
      else{
        console.log(error);
        var 
          alertDiv = $("#formValidationErrorMessageContainer").html(),
          $alertDiv = $(alertDiv);
          
        error.appendTo($alertDiv);
        $alertDiv.insertAfter(element);
      }
    },
    rules: {
      name: {
        required: true,
        minlength: 2
      },
      mol:{
        required: true,
        minlength: 5
      },
      description: textAreaValidationReq,

      targets:textAreaValidationReq,
      tasks: textAreaValidationReq,
      target_group: textAreaValidationReq,
      schedule: textAreaValidationReq,
      resources: textAreaValidationReq,
      finance_description: textAreaValidationReq
    }
  });

  // $(".projectTeam").rules("add", {
  //   required: true,
  //   minlength: 2
  // });
});
@@ -1513,16 +1513,42 @@
 ug here%0A
+    errorElement : %22div%22,%0A
     erro
@@ -1585,16 +1585,16 @@
 ement)%7B%0A
-
       va
@@ -1843,210 +1843,46 @@
     
-console.log(error);%0A        var %0A          alertDiv = $(%22#formValidationErrorMessageContainer%22).html(),%0A          $alertDiv = $(alertDiv);%0A          %0A        error.appendTo($alertDiv);%0A        $alertDiv
+error.addClass(%22alert%22);%0A        error
 .ins
@@ -2362,16 +2362,71 @@
 %0A  %7D);%0A%0A
+  // waiting for the autocomplete API from the backend%0A
   // $(%22

Fix a bug with the form validation error label style