user3856699
user3856699

Reputation:

Multistep From and one Submit button

I have a multi-step form in angular like this, how can I add save button for all steps ?

Is it possible ?
I mean when user is in form 1 only save data from 'form 1'

Upvotes: 0

Views: 310

Answers (1)

Yair Tavor
Yair Tavor

Reputation: 2538

You could use nested ng-form objects, but have an ng-submit only in the outer form, like this:

<ng-form name="master" ng-submit="doStuff()">
    <ng-form name="step1"> ... </ng-form>
    <ng-form name="step2"> ... </ng-form>
    <input type="submit" value="Submit" />
</ng-form>

Or you could skip the inner ng-forms if you don't need specific validation and just use plain form and divs to mimic the multi-form behavior.

Upvotes: 1

Related Questions