On Submit Register display only the register form

On Submit Register display only the register form

Hi,

I have two forms on one single page: " Sign in" form and ' 'Register" form.
Each time the page loads it shows only the "Sign in" form.

However I have two buttons on the top of the page: "Sign in" and "Register", which enable me to toggle between the two forms. If I click on "Register" button, the "Sign in" form gets hidden and if I click on "Sign in" button, the "Register" from gets hidden. You can see my example here:


It works. 

However the problem is that when I'm on Register form and click the Submit Register button at the bottom of the register form, the page loads again and shows the "sign in" form (as it is the default one).

I need a way to recognise that when I click on Submit Register button, after the page is loaded it shows me again the Register form, not the "sign in" form.

In short:
If I click on submit button in Register form, after loading the page, display the Register form instead of sign-in form.

How can I do that?

Thanks