![]() ![]() However, it is not ideal for me because Final Form doesn't receive the errors and pass them to the meta object for the form fields. I have considered just adding the validation directly in the submit handler.If you don't touch the form for the next 20 minutes then click submit, the submission should be prevented because your selected time is now 5 minutes in the past. It's valid now because it's currently in the future. If you're picking times for today, you may pick a time that is 15 minutes from now. I created this Sandbox to demonstrate what I mean. I have a feeling it's painfully obvious how to do this, but I can't figure it out. I tried using the pauseValidation and resumeValidation functions from FormApi but they couldn't achieve what I want, or maybe I'm not using them correctly. I have tried using the beforeSubmit listener from the final-form-submit-listener package but it only gives access to the FormApi object. This is the behavior I want to hook into and change the intervening time matters in my use case. Final form remembers the result of the validation that happens immediately after the value is changed, which means that the unchanged value remains valid regardless of how much time passes between the validation and the submission. It's not async I'm just trying to cover a scenario in which the user doesn't click submit for a while, and when they eventually do, the value would have become invalid. I have a form field whose value can become invalid if it's not submitted within a particular timeframe. Is there a way I can trigger a rerun of the validation when the form is submitted? Once a form's fields have been validated, submitting doesn't trigger a rerun of the validation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |