I'm writing an if statement that has multiple or in it. If validate1 returns true, it doesn't execute validate2 or validate3. But I need it to check validate2 and validate3.
I can't use && here, it is not satisfying my expectation as I tried. And I didn't want to write multiple if
Is there any way to solved this with one if statement?
if (this.validate1(x, y) || this.validate2(a, b) || this.validate3(c, d))
{ }
else {
showError();
}
I tried with and situations. Every validation is returning an error, with and if one of them is passing the validation then it's going to next step. This is not what i want.
And i write something wrong validate2 or validate3to be checked too.