Closed fredy31 closed 2 years ago
Hey @fredy31
This is a great question. I can think of two solutions.
Conditional fields with modes “display” and “include”… when using “include” it will remove the input fields name attribute when the condition is not met instead of hiding them with CSS only.
I need to add this information to the docs.
echo $form->toggle('Background');
echo $form->image('Image')->when('background', false)->conditionMode('include');
echo $form->background('Image')->when('background')->conditionMode('include');
Could there also be a thing where Typerocket would stop after like... 700 fields?
But yeah I should maybe ask my boss to push for Pro in this case.
@fredy31
You can set a limit on the repeater field if you needed to limit the number of fields $repeater->setLimit(10);
.
@fredy31
Added this information to the docs.
https://typerocket.com/docs/v5/conditional-fields/#section-modes
Thanks, Kevin
I've got a site with a huge repeater, with 20-30 fields in it, but most fields are not used on every lap through (Its basically text, product info, faq accordion, etc)
But thing is, when it saves it seems I've hit a limit at some point. There is too much information to save (the meta is about 40kb at the end of the 11th instance)
But a lot of that weight is empty fields saved like 'field':'' that are there every time. Would there be a way to quickly trim the fat by just putting in a condition that would make it that if the field is empty in the repeater, just don't put it in the serialized array?