Pass Form Instance when extending validators.
See original GitHub issueCan DVR Validation custom a rule like “shouldBeEqualTo” in this example [https://foxhound87.github.io/mobx-react-form/docs/validation/modes/vjf-custom.html] ? Because in Custom DVR, I don’t see the “form” param pass into the function like this:
const rules = {
telephone: {
function: (value, form) => value === form.$('other_field').value,
message: 'The :attribute is not equal with :other_field.',
},
};
Is there a way to do with it? Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to pass Form Group control value to a Custom Validator ...
I have a custom validator to check retype confirm
Read more >The best way to implement custom validators - Angular inDepth
Learning best practices on how to build your custom validator in Angular by reverse engineering the built-in Angular validators.
Read more >Validators - Angular
A validator is a function that processes a FormControl or collection of controls and returns an error map or null. A null map...
Read more >Reactive FormGroup validation with AbstractControl in Angular 2
FormGroup actually extends AbstractControl and then passes validator and asyncValidator to the AbstractControl through the super() call, ...
Read more >Working with Angular 4 Forms: Nesting and Input Validation
The input is an AbstractControl, which means that the argument can be any type that extends AbstractControl (FormGroup, FormControl and FormArray). The output ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will look into it.
@sprrw can you open another issue for your case? With code examples would be better.