I'm currently developing a website. I have two page in this scenario and 1st one is home page and second one is signup page. In first page I have two buttons called Login and Signup. In signup HTML page I've made login form and signup form using divisions. Simply saying one division contain login form and other contain signup form and depending on what I need, I simply hide what I don't want using onclick method.
What I want
Now I need, when I click on login button in home page, it should go to the signup page but signup division should be hidden and login division should be visible. And if I click on signup button in home page, it should go to the signup page but login form including division should be hidden and login division should be visible.
<div class="container">
<div id="loginBox" style="margin-top:50px;padding-top:80px" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
//Code//
</div>
<div id="signupBox" style="margin-top:50px;padding-top:80px" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
//Code//
</div>
</div>
My Approach
I thought to use javascript to access requesting page (signup page) and hide the suitable division and open the page. But I don't know how to do that. I couldn't find anything regarding on internet too. If you have another method which is easier than this please feel free to say. Thanks.