I have a multi-step form
<div ng-init="tab=1">
<form name="mf" novalidate ng-submit="mfCtrl.postForm()" >
<div ng-show="tab===1">
<div class="form-group ">
<label for="exampleInputEmail1">Full Name</label>
<input type="text" class="form-control" placeholder="Name" name="name" ng-model="mfCtrl.inputData.name" required />
<div class="error" ng-show="mf.name.$invalid && submitted">
<small class="error" ng-show="mf.name.$error.required">
Your name is required.
</small>
</div>
</div>
<button type="button" class="btn btn-primary next" ng-click="tab=2" >Next</button>
</div>
<div ng-show="tab===2">
<div class="form-group">
<label for="exampleInputEmail1">Mobile</label>
<input type="text" class="form-control inputfield" id="exampleInputEmail1" maxlength="10" placeholder="Mobile" name="mobile" ng-model="mfCtrl.inputData.mobile" ng-minlength=10 ng-pattern="/^[0-9]{1,10}$/" required />
<div class="error" ng-show="submitted && mf.mobile.$invalid">
<small class="error" ng-show="mf.mobile.$error.required">
Your mobile number is required.
</small>
</div>
</div>
<button type="button" class="btn btn-primary next" ng-click="tab=3" >Next</button>
</div>
<div ng-show="tab===3">
</div>
</form>
</div>
I want to do validation at each step but the button at each step is not a submit button. I have tried many things but nothing is working.In one of the method I used on clicking the button the validation works but it also increments tab which is of no use.
Please provide a solution for this problem.
Note- I don't wont to disable my button but show error on button click