Remote validation with kendo-validator

I am new to angular-js. I am developing an app using angular-kendo. I followed

  • http://kendo-labs.github.io/angular-kendo/#/Validator
  • http://www.telerik.com/forums/angular-kendo-validator .

Before implementing it in my real project, I will implement it in my text project. Look at my view:

 <form role="form" name="formTimeLine" kendo-validator="validator" 
 k-options="myValidatorOptions">
  <p>{{Welcome}}</p>
    <span class="label required">Name:</span>
      <input type="remarks" name="remarks" class="k-textbox" 
      ng-model="fiscalYear.Remarks" data-test="Please write sabbir."/><br>
       <span data-for='remarks' class='k-invalid-msg'></span>
      <button ng-click="Save()">Save</button>
  </form>

      

My validation rules in the controller:

  $scope.myValidatorOptions = {
    rules: {
        test: function (input) {
            if (input.is("[name=remarks]")) {

                return input.val() == "Sabbir"
            } else {
                return true;
            }
        }
    },
    messages: {
        test: "Your UserName must be Sabbir"
    }
  };

      

My save function looks like this:

   $scope.Save = function () {
    //$scope.formTimeLine.$valid
    if ($scope.validator.validate()) {
        alert("Saved");
    }
    else {
        alert("Error");
    }
};

      

How can I wire up the rule using kendo-validator so that the remote validation is triggered and validated? It is said that a custom directive and is used ctrl.$setValidity('unique', false);

, but the call $scope.validator.validate()

returns true.

+3
angularjs validation kendo-ui


source to share


No one has answered this question yet

Check out similar questions:

3998
How to validate an email address in JavaScript
3175
How do I validate an email address using a regular expression?
2303
Checking decimal numbers in JavaScript - IsNumeric ()
1012
(Inline) way in JavaScript to check if a string is a valid number
839
Full regex to validate phone number
812
What is the maximum length of a valid email address?
1
Remote validation over AngularJS with kendo-validator
0
Why does the textbox accept spaces as valid input on a kendo ui form?
0
Kendo Grid custom validation rules not working
0
Kendo custom login validation



All Articles
Loading...
X
Show
Funny
Dev
Pics