Skip to content
Advertisement

Validate form before submit in php with the routes

i must validate a form before submit, in this code I use routes, so i can’t use $_SERVER[“PHP_SELF”] (maybe) someone can help me please?

JavaScript

Thank you

Advertisement

Answer

The best way to validate without refreshing is Javascript, just add a onchange attribute to the input and validate through js.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement