Repeater area: Keep first entry

pat01 06 Sep, 2019
Hi

I did have a look at your demo repeater form.

There it's possible to add more "Guests" and remove them as well.

Is there a way to prevent removing the first entry "Guest 1"?

Users should only be able to remove additional "Guest", but not the first one.

Thanks.

Patrick
GreyHead 06 Sep, 2019
1 Likes
Hi Patrick,

The simplest way to do this might be to add guest 1 to the main form and use the repeater from guests 2 . . . and on. It's probably possible to add custom JavaScript to stop the first one being deleted but that might be ore complicated to do.

Bob
pat01 07 Sep, 2019
Hi Bob

Thank you.

Disadvantage would be, that there are two Guests on form load, instead of just one.

But at least it would not be possible to remove first guest.

Patrick
GreyHead 07 Sep, 2019
Hi Patrick,

Can you hide the whole multiplier until the user checks an Add more Guests checkbox?

Bob
pat01 07 Sep, 2019
Hi Bob

Unfortunately the Repeater area has no "Events" tab, so I can't do that.

Patrick
Max_admin 21 Sep, 2019
Answer
1 Likes
You can hide the repeater with an event in the checkbox with target id as the repeater area id

Best regards
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.

VPS & Email Hosting 20% discount
hostinger