I\'m trying to validate my form with the easiest way possible, but somehow it is not working and when I click submit it just takes me to the next page without giving the ale
You need to return the validating function. Something like:
onsubmit="return validateForm();"
Then the validating function should return false on errors. If everything is OK return true. Remember that the server has to validate as well.