Unobtrusive validation not working on dynamically-added partial view

Ok, I am going to start over with a new answer here. Before you call $.validator.unobtrusive.parse, remove the original validator and unobtrusive validation from the form like so: var form = $(“#main_div”).closest(“form”); form.removeData(‘validator’); form.removeData(‘unobtrusiveValidation’); $.validator.unobtrusive.parse(form); This same answer is documented here.

How can I dynamically add a directive in AngularJS?

You have a lot of pointless jQuery in there, but the $compile service is actually super simple in this case: .directive( ‘test’, function ( $compile ) { return { restrict: ‘E’, scope: { text: ‘@’ }, template: ‘<p ng-click=”add()”>{{text}}</p>’, controller: function ( $scope, $element ) { $scope.add = function () { var el = $compile( … Read more