                 $el.find(".new-value input:visible").first().focus()
 
         saveValue = (target) ->
-            form = target.parents("form").checksley()
+            formEl = target.parents("form")
+            form = formEl.checksley()
             return if not form.validate()
 
-            value = target.scope().value
+            value = formEl.scope().value
             promise = $repo.save(value)
             promise.then =>
                 row = target.parents(".row.table-main")


        cancel = (target) ->
            row = target.parents(".row.table-main")
            value = target.scope().value
            $scope.$apply ->
                row.addClass("hidden")
                value.revert()

                form.setErrors(data)

        saveNewValue = (target) ->
            formEl = target.parents("form")
            form = formEl.checksley()
            return if not form.validate()

            $scope.newValue.project = $scope.project.id
