troch / angular-multi-step-form

An angular module for creating multi step forms / wizards

Home Page:http://troch.github.io/angular-multi-step-form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On Next button click validate the form

madhuvuvaddi opened this issue · comments

I have verified that here we are disabling next button until the form is valid but I want to validate and set the focus to first element of the step when user hit the next button is it possible with this library?
want to call this code on next step
if(!formCtrl.$valid){
element[0].querySelector('.ng-invalid').focus();
var myEl = angular.element( element[0].querySelector('.ng-invalid') );
myEl.css('border','solid 1px red');

             }

This has nothing to do with this library, within a step (partial + controller) you can do whatever you want.

Thanks for your quick response.Where exactly I need to put this code nextstep()?
Then how to get that element in nextStep().Could you please help me to resolve this.

From a controller where you call $nextStep you can inject $element. I can't help further.