I am new to jquery and bootstrap, so please review my errors. I created bootstrap modal for login and registration. It contains two navigation tabs called login and registration. I have two buttons that go to the same Modal window, but display another tab inside the Modal window. Each tab has a form with several inputs. My problem is that the modality popped up with the login tab open in modal mode when I click the "Login" button and open the registration tab when I click the "register" button on my page.
These are 2 links that open the modal form:
<div class="header-login-li" style="background-color:gray;float:left;width:100px;height:60px;"> <a data-toggle="modal" href="#regestration" class="header-register-a" > <big> <font color="white" class="header-register-font"><center style="margin-top:20px;">Login <i class="icon-chevron-down" style="font-size:20px"></i></center></font> </big></a></div> <div class="header-register-li" style="background-color:green;float:right;margin-right:-15px;width:130px;height:60px;"> <a data-toggle="modal" href="#regestration" class="header-register-a" > <big> <font color="white" class="header-register-font"><center style="margin-top:20px;">Register</center></font> </big></a>
Here is my code for the tabs and their contents (I avoid unnecessary code here):
<div class="tabbable" > <ul class="nav nav-tabs" > <li class="active" style="position:absolute;margin-left:0px;" id="logintab"> <a href="#pane_login" data-toggle="tab">Login</a></li> <li style="margin-left:70px;" id="reg_tab" ><a href="#pane_reg" data-toggle="tab">Registration</a></li> </ul> <div class="tab-content"> <div id="pane_login" class="tab-pane active"> <form id="login-form" target="login-signup-iframe" method="post" action="#" name="login-form"> </form> </div> <div id="pane_reg" class="tab-pane"> <form id="regestration-form" target="login-signup-iframe" method="post" action="#" name="regestration-form"> </form> </div> </div> </div>
I think this can be done through jquery easily. But I donβt know exactly how to do this. So please, can someone help me solve my problem. Thanks in advance?
javascript jquery html css twitter-bootstrap
sachin_ware Oct 25 '13 at 11:50 2013-10-25 11:50
source share