To fix our validation flaw, what we can do is we can set isValid true by default here at the beginning
and then we can add something to each check
here. We can say isValid should it be true if this check is true
and if isValid already was true
so we change && isValid. If we do
this in every rule, then just this rule resolving to true alone won't do the trick,
all the rules now have to resolve to true.
So if we save it with this change in place and I now start entering into the zip code, one digit it's
false, no digits it's false,
now if I enter five digits, it's true because it's not too long not too short
and there, if I interest six digits though, it's false.
Now if I have a look at the name and I enter something there, you see it's true because I entered something,
if I empty it you'll see it's false because now it's empty.
This is now our own validation working,
we got our own rules set up in this flexible way,
now we can turn our heads towards also outputting some feedback on our validation result.