javascript - charCodeAt() working with some validations, but not some other validations -


I could swear that I verified everything properly, as long as my teacher recognized every possible combination of characters I decided to look at and in some way I got 10 points. So I went to my code and tried to fix the verification, but, although it is like an example in the lecture framework, it decides to pass the form inadvertently to A1. I have examined the Assi four code chart

and still getting through 1. This is my code section:

  else if (f1.state.value.length! = 2 ||! ((F1.state.value.charCodeAt (0)> = 65 & Amp; amp; amp; amp; f1.state.value.charCodeAt (0) & lt; = 90) || (f1.state.value.charCodeAt (1)> = 97 & amp; amp; amp; Amp; amp; amp; 1 .state.value.charCodeAt (1) & lt; = 122)) {Warning ('Please enter a state in the unauthorized form'); F1.state.focus (); return false; }  

Why is happening through 1?

Edit: Also, I work 1 (or does not work), but not a1.

Interesting, I took it! Outside and every person was placed around the bracket! And it works .. So it was returning the truth that one or the other truth was ... again! Ing

So it should have happened:

  else if (F1.state.value.length! = 2 || ((F1.state.value.charCodeAt (0 )> = 65 & amp; amp; amp; F1 .state.value.charcodeite (0) & lt; = 90) | (F1.state.value.charCodeAt (1)> gt; = 97 & amp; amp; ; Amp; amp; f1.state.value.charCodeAt (1) & amp; lt; = 122)) {Warning ('Please enter a State in Deprecated form'); f1.state.focus (); The description is false;}  

Comments