Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
hi I have problem with custom validation in js plugin:
my html:
<div id="u7dtgSliderEvent" ng-controller="u7dtgSliderEvent.editorController"> <input type="hidden" ng-model="validationTest" val-property-validator="validateMandatory" />
my js:
angular.module("umbraco") .controller("u7dtgSliderEvent.editorController", function ($scope, $timeout) {
$scope.validationTest = null; $scope.validateMandatory = function () { return { isValid: false, errorMsg: "Value cannot be empty", errorKey: "required" }; } });
validateMandatory function is executed ones on plugin load, return false, but nothing happend on saving data. What i make wrong?
i took this example from https://github.com/umbraco/Umbraco-CMS/tree/9290f61f9485c5bef0aa9a95e05e8acefa9ce221/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags
but it doesnt work.
Can somebody help my?
I just hit the same issue. When I click save on the page, I briefly get the error message, but the page still submits and saves. Did you find a solution?
Hello,
Have you found any solution regarding this issue ? I just ran on it (using Umbraco 10.2)
I know this is somewhat late, but I think the OP wasn't checking the correct branch (it appears he was checking something prior to v9).
Anyway, if you take a look at this
https://github.com/umbraco/Umbraco-CMS/blob/v9/dev/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js
(which is used in the new tag editor https://github.com/umbraco/Umbraco-CMS/blob/v9/dev/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html)
I believe you'll have to "hook" your validation to the validateMandatory inside your controller, not the view.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Custom validation not working
hi I have problem with custom validation in js plugin:
my html:
<div id="u7dtgSliderEvent" ng-controller="u7dtgSliderEvent.editorController"> <input type="hidden" ng-model="validationTest" val-property-validator="validateMandatory" />
my js:
angular.module("umbraco") .controller("u7dtgSliderEvent.editorController", function ($scope, $timeout) {
validateMandatory function is executed ones on plugin load, return false, but nothing happend on saving data. What i make wrong?
i took this example from https://github.com/umbraco/Umbraco-CMS/tree/9290f61f9485c5bef0aa9a95e05e8acefa9ce221/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags
but it doesnt work.
Can somebody help my?
I just hit the same issue. When I click save on the page, I briefly get the error message, but the page still submits and saves. Did you find a solution?
Hello,
Have you found any solution regarding this issue ? I just ran on it (using Umbraco 10.2)
I know this is somewhat late, but I think the OP wasn't checking the correct branch (it appears he was checking something prior to v9).
Anyway, if you take a look at this
https://github.com/umbraco/Umbraco-CMS/blob/v9/dev/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js
(which is used in the new tag editor https://github.com/umbraco/Umbraco-CMS/blob/v9/dev/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html)
I believe you'll have to "hook" your validation to the validateMandatory inside your controller, not the view.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.