Search code examples
phpwizardnettelatte

Nette framework - form wizard


I am trying to create form wizard in nette 2.1.2. I've created my own component in which nette form can be injected. Then in latte template is form rendered to individual steps.

However, I want to perform validation of form fields in the current step, before switching from this step to another. For this I need two things:

  • Access to nette form fields from component before form is posted
  • Manualy start validation for selected form fields

Can you help me how can I do this?


Solution

  • The usual solution is to create form component for each step of your wizard. This form components should be (as you already did) wrapped in another component. The state between steps should be saved by your component, getting step results should be done as usual, as is described in doc.