There are regular

^([a-z0-9_\.-]+)@([а-яa-z0-9\.-]+)\.([az\.]{2,6})$ 

I fill out the form and intend to leave one of the required fields empty, I press send. As planned, it gives an error that the field is valid. Login empty. I enter the login and press it again and then it gives an error that the email is wrong, I press again, the error disappears, I press again, the error to the wrong email appears again (all the fields are correct). In short, if you submit a form 50 times in a row, then the error will pop up every other time. On the other hand, if the page is just updated, then there is no error. There are no troubles in the script, a few more fields are checked regularly, but is the shift exactly on the soap? What could be the reason?

  • The reason may be elsewhere in the code. For example, if you are trying to set / remove a value in a session. - ling
  • Sessions are not used yet. - Palmervan
  • Learn to debug your code. In the error message, add more soap. what would be seen what it is (all of a sudden it is not transmitted at all, or is not transmitted correctly) and seeing the email it will be possible to draw a conclusion, either the regular schedule does not work correctly or the email is not correctly transmitted ... - Alex Kapustin
  • I watched just now, I transferred the variable to the wrong one ...) Brain can't be fixed by a script © - Palmervan

1 answer 1

At least, minus place at the beginning of the character class. So it is more correct.

  • knes cool) Now everything is ok. Thank! - Palmervan