My index page starts with login form, underneath the "Log in" button there's a sign up message for those who have not made the account yet. I made both registration and login form inside one div and used javascript to toggle between them when clicking anchor tag (either "Log in" or "Sign up"). I've made a login system already but Im having issues with registration and it's validation. Since both forms are on the same page and default one is login one there is a problem with validation because when you're trying to register a and you provide a username that's too short the page reloads and you're back to login form, then need to click "Sign up" again to toggle between the forms and there's the validation error. Is there anyway I can somehow stop the page from reloading or making it so the website remember that you were at registration form?
I hope I explained my issue good enough, english is not my native language...
I can provide any code needed.
Well I guess the other way to prevent that from happening would be swapping forms and making registration form the default one but is there an answer to my question?