Generate n Multi Field automatically

Generate a specific number of multi fields automatically in ChronoForms.

Overview

The issue occurs when needing to display a dynamic number of multi fields based on a user-provided value, without using the multiplier feature.
Use a custom code field with a for loop to generate the required number of multi fields, retrieving the user input value from the form data.

Answered
Ke Kenjy-15 20 Dec, 2016
Hello everybody,

I have a form (multipage) to enter information on biological samples. The user select a "number of total sample" and click on "Add" button. An other page is display with multi field for one sample.
I would like to display n multi field with n is the "number of total sample" entered before.

How can I say to CF: The value of total sample number is 5 (it's an example), display 5 multi fields ?

I don't want to use multiplier because there is no limit to add fields, and I want to display only the number of fields corresponding to the total number sample.

I hope to be understandable.
Max_admin Max_admin 21 Dec, 2016
Answer
Hi Kenjy,

You will need a custom code field to do this, with a for loop, but you will have to use your own field or multifield HTML code.

You can get the value of the samples (or any field) using $form->data["field_name"]

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.