Giter Club home page Giter Club logo

Comments (7)

hueitan avatar hueitan commented on May 25, 2024

You can manually call the validate API by using

this.$validationProvider.validate( form )

from angular-validation.

codeuniquely avatar codeuniquely commented on May 25, 2024

Ye si know you can call that and i do when the user hits SUBMIT, but that call validates the entire form - causes all inputs on the form to have their validation checked and any associated messages will be fired and shown in the UI.

This is not what I asked:

What I asked, was for was way to validation just a single input:

There is a UX business case with my customer that requires:
That ONLY validation on the effected control, related to the input entered (which now causes that previous entry to be invalid) MUST be shown. All other validation messages not related to that changed input MUST NOT display ANY validation messages.

I know the related fields and i want to trigger the validation to fire on the related input ONLY, not the whole form.

from angular-validation.

hueitan avatar hueitan commented on May 25, 2024

yes, you can validate only single one input

<form name="Form">
    <input type="text" name="required" ng-model="required" validator="required"/><input type="text" name="required2" ng-model="required2" validator="required"/>
</form>

<script>
// ...
validationProvider.validate($scope.Form.required)
// ...
</script>

from angular-validation.

codeuniquely avatar codeuniquely commented on May 25, 2024

Sorry but just to be sure,

You can validate a given named input (covered by validation rules)

i.e.

if ( input_needs_validation && form && input_name) {
    let input = form[input_name];
    validationProvider.validate( input );
}

from angular-validation.

hueitan avatar hueitan commented on May 25, 2024

from angular-validation.

codeuniquely avatar codeuniquely commented on May 25, 2024

OK cool - then we can close this - because that exactly what I need

:)

from angular-validation.

hueitan avatar hueitan commented on May 25, 2024

Perfect 👍

from angular-validation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.