Open ma-gu-16 opened 1 year ago
@ma-gu-16 Thank you for your patience with this issue. Can you please describe it in more detail? I don't quite understand what you mean by creating an element after click/user input.
If you visit a new page it should be possible to show default fields at the beginning. without user interaction to click the "add" button.
Ok, here's what I understand: I as a visitor call a page with a form (and repeatable_elements). I expect that there are already fields that I can fill in. But currently I have to click on “add” to create input fields.
Or does your statement refer to the edit form in the backend:
I as an editor edit a form in the backend. I expect that when I add the element repeatable_container
, there are already some input fields in it.
the first one. you as a visitor.
I think I understand now: As a visitor, I can specify which form fields I can submit.
Example: The editor has created a form containing contact data and an (empty) repeatable_container in which a user can create any input fields from a minimum to a maximum number of times. To be specific: As a visitor, I decide that I can send 1 text field, 1 textarea, 2 checkboxes and 3 upload fields to the form recipient as long as the editor has allowed at least 7 copies to be created in the repeatable_container.
Is this correct?
As a TYPO3 administrator, I configure a form, e.g., name, street, city, email address. Now, I want the email address to be a repeating element and a mandatory field. This means one email is required, but optionally, the visitor can add more emails, which, of course, must also be validated as mandatory and valid email addresses.
Currently, when I try to implement this, the repeating form (i.e., the email field) is not present initially. I have to click on the "+" to make an email field appear.
It should be possible to configure the form so that one or more sections are already rendered in the form. For example, the visitor comes to the form and already sees name, street, city, email address, email address, email address.
With the "+" button, they can add more, or with the "-" button, they can remove, but only as many as configured initially.
same config for the opposite way... visitor is showing up and sees name,street,city and have to press "+" to add at least 1 required email.
ok, i have configured an form.yaml as i understood your request. I cannot reproduce that its needed to click + to show the first email input. its there from the start.
can you confirm or adapt the form.yaml to show your case?
renderingOptions:
submitButtonLabel: Submit
type: Form
identifier: issue-33
label: issue-33
prototypeName: standard
renderables:
-
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'
type: Page
identifier: page-1
label: Step
renderables:
-
defaultValue: ''
type: Text
identifier: text-1
label: Name
-
defaultValue: ''
type: Text
identifier: text-2
label: Street
-
defaultValue: ''
type: Text
identifier: text-3
label: City
-
properties:
minimumCopies: 0
maximumCopies: 10
showRemoveButton: true
copyButtonLabel: Copy
removeButtonLabel: Remove
type: RepeatableContainer
identifier: repeatablecontainer-1
label: 'Repeatable container'
renderables:
-
defaultValue: ''
type: Email
identifier: email-1
label: Email
validators:
-
identifier: EmailAddress
-
identifier: NotEmpty
properties:
fluidAdditionalAttributes:
required: required
same config for the opposite way... visitor is showing up and sees name,street,city and have to press "+" to add at least 1 required email.
minimumCopies: 0 then there should be nothing. ?
minimumCopies: 0
means, there is only the original input element and no need to copy this item.
if you set it to minimumCopies: 1
, then you need to copy the original input element at least once.
yes and my feature request, is: it should be possible to start with no default.
ok, thank you. i will have a look into this.
Is there a possibility to create a repeatable element after click/user input and not an default one. ?