All Projects → TheSharpieOne → Angular Validation Match

TheSharpieOne / Angular Validation Match

Licence: mit
Checks if one input matches another. Useful for confirming passwords, emails, or anything.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Angular Validation Match

Formhelper
ASP.NET Core - Transform server-side validations to client-side without writing any javascript code. (Compatible with Fluent Validation)
Stars: ✭ 155 (-32.02%)
Mutual labels:  form-validation
Validetta
A tiny jquery plugin for validate forms
Stars: ✭ 175 (-23.25%)
Mutual labels:  form-validation
Documentation
📋 Official documentation/website
Stars: ✭ 202 (-11.4%)
Mutual labels:  form-validation
Formiz
🐜 React forms with ease! Composable, headless & with built-in multi steps
Stars: ✭ 159 (-30.26%)
Mutual labels:  form-validation
Formr
Create and Validate PHP Forms in Seconds.
Stars: ✭ 163 (-28.51%)
Mutual labels:  form-validation
Composable Form
Build type-safe composable forms in Elm
Stars: ✭ 179 (-21.49%)
Mutual labels:  form-validation
Modal progress hud
A simple modal progress HUD (heads-up display, or progress indicator) for flutter
Stars: ✭ 137 (-39.91%)
Mutual labels:  form-validation
Resolvers
📋 Validation resolvers: Zod, Yup, Joi, Superstruct, and Vest.
Stars: ✭ 222 (-2.63%)
Mutual labels:  form-validation
Validator
A tiny library for easily validating TextInputLayouts in Android
Stars: ✭ 169 (-25.88%)
Mutual labels:  form-validation
Material Singleinputform
A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform
Stars: ✭ 202 (-11.4%)
Mutual labels:  form-validation
Yaaf
Easing the form object pattern in Rails applications
Stars: ✭ 161 (-29.39%)
Mutual labels:  form-validation
Sveltejs Forms
Declarative forms for Svelte
Stars: ✭ 163 (-28.51%)
Mutual labels:  form-validation
Redux Form
A Higher Order Component using react-redux to keep form state in a Redux store
Stars: ✭ 12,597 (+5425%)
Mutual labels:  form-validation
Ionic Forms And Validations
📝 Ionic Tutorial - Learn to use Forms and Validations in Ionic Angular apps. Get a FREE Ionic 5 Forms Starter App and learn to handle simple and custom validations. Includes complete ionic forms tutorial!
Stars: ✭ 155 (-32.02%)
Mutual labels:  form-validation
Validator
HTML form validation. Perfectly made for all scenerios, lightweight, semantic & easy to use
Stars: ✭ 209 (-8.33%)
Mutual labels:  form-validation
Vue Dynamic Forms
Easy way to dynamically create reactive forms in vue based on a varying business object model
Stars: ✭ 146 (-35.96%)
Mutual labels:  form-validation
Availity Reactstrap Validation
Easy to use React validation components compatible for reactstrap.
Stars: ✭ 176 (-22.81%)
Mutual labels:  form-validation
Validate
A lightweight form validation script.
Stars: ✭ 227 (-0.44%)
Mutual labels:  form-validation
Bouncer
A lightweight form validation script that augments native HTML5 form validation elements and attributes.
Stars: ✭ 224 (-1.75%)
Mutual labels:  form-validation
Elm Form
Dynamic forms handling in Elm
Stars: ✭ 189 (-17.11%)
Mutual labels:  form-validation

Build Status Code Climate Test Coverage Coverage Status Dependency Status devDependency Status

Angular Validation: Match

Checks if one input matches another. Useful for confirming passwords, emails, or anything.

The match attribute should be set equal to the ng-model value of the field to match.

Demo: http://jsfiddle.net/TheSharpieOne/r6Ltru6c/

Installation

bower install angular-validation-match

Then add validation.match to your angular dependencies

Note: For angular 1.2 or lower use bower install angular-validation-match#1.3

Also: npm install angular-validation-match

Usage

Simple Property Example

Password: <input ng-model="password" type="password" />
Confirm: <input ng-model="passwordConfirm" type="password" match="password" />

Object Property Example

Password: <input ng-model="user.password" type="password" />
Confirm: <input ng-model="user.passwordConfirm" type="password" match="user.password" />

Case insensitive (caseless) Example

Password: <input ng-model="user.password" type="password" />
Confirm: <input ng-model="user.passwordConfirm" type="password" match="user.password" match-caseless="true" />

match-caseless can accept a scoped variable to allow the matching to be toggle-able between case insensitive and case sensitive. Default: false

Not Match Example
Sometimes you want to ensure the values do not match, in that case you can use the not-match flag. This also works in combination with match-caseless (if you want to not match case insensitively).

Password: <input ng-model="user.password" type="password" />
Confirm: <input ng-model="user.passwordConfirm" type="password" match="user.password" not-match="true" />

not-match can accept a scoped variable (true/false) to be toggle-able between matching and not matching. Default: false

Ignore empty Example

Password: <input ng-model="user.password" type="password" />
Confirm: <input ng-model="user.passwordConfirm" type="password" match="user.password" match-ignore-empty="true" />

match-ignore-empty can accept a scoped variable to disable validating an empty input. Default: false

Display Custom Error
If your form and field both are named, you can access the validation result to show/hide messages.

<form name="myForm">
      Password: <input ng-model="user.password" type="password" name="passwordName" />
      Confirm: <input ng-model="user.passwordConfirm" type="password" match="user.password" name="myConfirmField" />
      <div ng-show="myForm.myConfirmField.$error.match">Fields do not match!</div>
</form>

Validate Against the $viewValue shown in the input
The internal value ($modelValue) can differ from the external value ($viewValue) as appears in the input field shown to the user. If your form and field both are named, you can validate against value displayed in the field, even if the field is invalid.

<form name="myForm">
    Password: <input ng-model="user.password" type="password" name="myPasswordField" />
    Confirm: <input ng-model="user.passwordConfirm" type="password" match="myForm.myPasswordField" name="myConfirmField" />
</form>

Note: $viewValues are specific to fields/elements, not models. Different fields with the same ngModel and have different $viewValues. Becuase of this, you need to use the form directive (assigning a name to a form tag) in combination with the specific field's name attribute to specific which field/element you want to match in particular.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].