Hello.
I am finally figuring out some basic validation.
My main interest at this point is validating email.
The script I got online contains the following, but does not check for "com", etc:
if (email.indexOf("@") == -1 || email.indexOf(".") == -1)
This works but does not check for "com". It MUST check for "com". So, I added this:
|| email.indexOf +2 > text.length )
To come up with this:
if (email.indexOf("@") == -1 || email.indexOf(".") == -1 || email.indexOf +2 > text.length )
The results: After adding the "." and submitting, there is no error message indicating that the field is missing "com".
This is imperative that I fix this.
Please advise.
Thank you in advance!
Matthew