I use devextreme validators for check my required fields on the form. I added a button on the form. The button checks validators and submit the form. But when I use keydown (F2, F3 buttons etc.) it doesn't check validators and submit the form directly. I want, F2 button must work like button on the form.
I also created a plunker for the problem: http://plnkr.co/edit/qoOMAsjKnKJLcbHZ?preview
As you can see, when you click the Save button directly (textbox values must be empty for check validators work or not) it controls the validators. But when you press "F2" (mouse cursor must be in the textbox field and textbox values must be empty), it submits the form without control validators.
So, what should I do?
Thanks.
I used "dx-validation-group" widget for this solution. I needed that devextreme widget.
I fixed my plunker like this: http://plnkr.co/edit/qoOMAsjKnKJLcbHZ
I gave a tag to "dx-validation-group" widget something like this: #validationGroup
After that, I controlled that isValid or not.
if (!this.validationGroup.instance.validate().isValid)
return;
Now it checks the validators.