On-Demand Form Validation

To create a customer, I’m using a FormLayout with validation. When user clicks, submit, a customer is created in the backend. The issue is, I allow same Form to keep creating customers and so once the first customer is created and form is cleared, it shows in RED like here. So, how to enable the validation only when the submit button is clicked ?

How do you clear the form?

I use a method which clears all text fields

So no binder involved and just using .clear()?


Just saying the obvious: use a binder.

Only thing that comes otherwise to mind would be to try to call clear twice, I’ve heard some occasions where it helped :sweat_smile:

clearing the form twice is the trick

that worked