Before submitting the form, I check if the token matches like this: HTML: And for some reason, else is always triggered, although in theory the check should occur when sending data. What could be the problem? UPD.And besides, the error text is constantly visible at the top of the page, although I display all notifications using responseText(ajax request) and bootstrap