I'm trying to move to the next tab by clicking on a button like "save and continue". I want to create a button to move to the next tab. Every tab contains some text boxes.
When the user fills the last textbox of tab 1 and clicks on the "save and continue" button, I want to display tab2. When the user reachs tab3 I want to hide the "save and continue" button.
How to solve this problem?
Html code is
<ul class="nav nav-tabs col-xs-offset-2 col-md-offset-2 ">
<li class="active"><a href="#info-tab" data-toggle="tab">Information <i class="tabs"></i></a></li>
<li ><a href="#personalinfo-tab" data-toggle="tab">Personal Information <i class="tabs"></i></a></li>
<li><a href="#address-tab" data-toggle="tab">Address <i class="tabs"></i></a></li>
</ul>
<div class="margintop"></div>
<form name="userForm" class="signin form-horizontal col-xs-offset-2 col-md-offset-0" novalidate autocomplete="off">
<div class="tab-content">
<div class="tab-pane active" id="info-tab">
<div class="form-group">
<label class="control-label col-xs-3 col-md-3" for="firstName">First Name:</label>
<div class="col-xs-7">
<input type="text" required id="firstName" name="firstName" class="form-control" id="firstName" data-ng-model="credentials.firstName" placeholder="First Name">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3 col-md-3" for="lastName">Last Name:</label>
<div class="col-xs-7">
<input type="text" class="form-control" name="lastName" class="form-control" data-ng-model="credentials.lastName" id="lastName" placeholder="Last Name">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3 col-md-3" for="inputEmail">Email:</label>
<div class="col-xs-7">
<input type="email" class="form-control"name="email" class="form-control" data-ng-model="credentials.email" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3 col-md-3" for="lastName">User Name:</label>
<div class="col-xs-7">
<input type="text" class="form-control" name="username" class="form-control" data-ng-model="credentials.username" id="userName" placeholder="User Name">
</div>
</div>
</div>
<div class="tab-pane" id="personalinfo-tab">
<div class="form-group">
<label class="control-label col-xs-3 col-md-3" for="gender">Gender:</label>
<div class="col-xs-6">
<input type="radio" ng-model="credentials.gender" value="Male" />Male
<input type="radio" ng-model="credentials.gender" value="Female" />Female
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3 col-md-3" for="designation">Designation:</label>
<div class="col-xs-7">
<input type="text" class="form-control" name="designation" class="form-control" data-ng-model="credentials.designation" id="designation" placeholder="Enter Designation">
</div>
</div>
</div>
<div class="tab-pane" id="address-tab">
<div class="form-group">
<label class="control-label col-xs-3 col-md-3" for="mobile">Mobile No:</label>
<div class="col-xs-7">
<input type="text" class="form-control" name="mobile" class="form-control" data-ng-model="credentials.mobile" id="mobile" placeholder="Enter Mobile No">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3 col-md-3" for="address">Address:</label>
<div class="col-xs-7">
<textarea rows="4" cols="50" class="form-control"name="address" class="form-control" data-ng-model="credentials.address" id="address" placeholder="Enter Address"></textarea>
</div>
</div>
<div style="margin: 15px">
<div class="form-group">
<div class="col-xs-offset-3 col-xs-8 ">
<input type="submit" class="btn btn-primary" data-ng-click="adduser()" value="Create New Associate">
</div>
</div>
<div data-ng-show="error" class="text-center text-danger">
<strong data-ng-bind="error"></strong>
</div>
</div>
</div>
</div>
<button class="btn btn-small" ng-click="proceed()">save and continue</button>
</form>
</div>
Javascript code
$scope.proceed = function() {
};