Coder Social home page Coder Social logo

Comments (6)

troch avatar troch commented on September 20, 2024

For this reason, the validity of the form is false until all required fields are filled out throughout the entire form within each step

Sounds about right. If a field is required, then your form cannot be valid until those fields are filled.

Whether you wrap your form around or within the step container, it should have roughly the same result: each form element in Angular registers itself with its parent form when created and de-registers itself when destroyed. For that reason, the reported validity is for the currently present form elements.

from angular-multi-step-form.

remib avatar remib commented on September 20, 2024

Ok, I understand that. Is my issue not something that is essential for a multistep form, though?

It's a multistep-form, meaning it's one form with mulitple steps. I'd like to disable the 'Next' button until the fields in the current step are valid, not all fields in the form.

from angular-multi-step-form.

troch avatar troch commented on September 20, 2024

That sounds a bit weird, it shouldn't normally be concerned about validity of other steps as only elements for the current step are present.

from angular-multi-step-form.

remib avatar remib commented on September 20, 2024

I've just done some more tests and it does seem like the module is fussy about where the <form> tags are placed. Interestingly, ng-model validation does not work at all if the <form> tags are placed around the step-container; valid is always true. I believe the same can be said for the validation within the module, validation does not appear to function if the form tags are not within the step-container.

Once I place the <form> tag within the step template, everything works as expected but I want to avoid using a new<form> tag for every step as I have > 20 steps in 4 forms.

Thanks again

from angular-multi-step-form.

troch avatar troch commented on September 20, 2024

Using a <form> tag in every step is not really an issue. Only one is present at any time. I would recommend doing it that way, it probably removes a few edge cases.

I need to have a look anyway.

from angular-multi-step-form.

remib avatar remib commented on September 20, 2024

Yeh ok, it does seem to do the trick. I had it in my mind that I'd end up with loads of objects at the end but the data is tied to ng-model, not the form name. Cheers.

from angular-multi-step-form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.