question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass Form Instance when extending validators.

See original GitHub issue

Can 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
foxhound87commented, Oct 27, 2018

I will look into it.

0reactions
foxhound87commented, Feb 15, 2019

@sprrw can you open another issue for your case? With code examples would be better.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found