Javascript errors will show in the developer's console by default. Press F12 in most major browsers to bring it up.
How to display a error message in JavaScript?
We can show errors with two methods without using the alert box. Syntax: node. textContent = "Some error message" // To draw attention node.
How do I show error messages in a popup?
The best way is that, use ajax to submit form . But if u don't want to use ajax then at first, if error comes, write error message in session. then after redirection in home page, check session if error is or not. If error is there then show the model with error message.