Written
If you are a form developer or building a complex application then you may find that you want to repeat some form elements or groups of elements many times.
First off, ChronoForms isn't very sub-form friendly but it is possible to get some results with a little work.
Off the top of my head I can think of several possible approaches:
- The ChronoForms Show Form action will allow you to embed one form inside another. I haven't worked with it yet but this looks like a good option.
- You can use multi-step forms. ChronoForms makes it fairly easy to pass the user and the form data from one step to the next so you could have a 'Contact' form and include that in many different sequences of steps. You'd need though to include some routing instructions so that the Contact form redirected correctly to the next form in the sequence.
- You can use Custom Element elements with included code. The ChronoForms Wizard creates a chunk of HTML. You can grab this from the form Code tab - prettify it a little and save it to a file, then include that file into a Custom Element element using a PHP include statement.
- You can use PHP to generate the HTML you need. There's a whole range of options here from a little tweaking of included files to building functions to create your own blocks of inputs.