How can I validate if a form is valid (in a widget outside the form)?


Just came up with another question and probably a bug.

I have form1 and form2 side-by-side and I intend to enable a button on form2 only if BOTH forms are valid. Form1 will never be submited by itself (its data will be submited by form2 query). I’ve created it as a form since I expected to be easier to validate that way.

  • Form object doesn’t has a “.isValid” property (which would make it much easier);

  • I’ve tried to use a “form button” on form 1 as a simple flag: made sure “Disabled Invalid Forms” was enabled and invalidated the form data from a required field. However, {{form1button.isDisabled}} returns “undefined” instead of “true”;

  • Done a few more tests and figured that {{form1button.isDisabled}} property is never updated.

It seems to be a bug on the “form button”, but as it’s being deprecated, don’t really know if a bug report is appropriate.

In the meantime, do I have any other way to check if form1 is valid (except validating every single field on the button)?

Hey! I second your findings. This looks like a bug. I’ll ask the team to include this case in the test plan for the newer alternative.