Can repeater fields default to null?

By: isaac Ruiz | Asked: 04/25/2024
ForumsCategory: General questionsCan repeater fields default to null?
isaac Ruiz asked 7 months ago
Hello,   I built a form for my team where I have a repeater field attached to a Single Product. The issue I have is that the product price is calculated in the total. I would like the repeater field to default to Null so that if one of my employees ADDs the field, the product is then added. 
Attachments
4 Answers
Best Answer
Bobby Clapp answered 7 months ago
Victor Font replied 7 months ago

Great innovative solution Bobby!

isaac Ruiz replied 7 months ago

Bobby, thank you so much!!! works perfectly!!!!!!

isaac Ruiz answered 7 months ago
The image I provided shows what I would like it to display 
Rob LeVineRob LeVine answered 7 months ago
I want to make sure I understand your request. Am I correct that A. You have a repeater section and one of the fields in it is a calculation. B. When you add a repeater row, you want the value "Domain Total" to be empty, rather than the value of zero which is the result of the calculation?
isaac Ruiz replied 7 months ago

Not exactly. Here is a video I shot, maybe this will help: https://somup.com/cZfTr35fhL

Rob LeVineRob LeVine replied 7 months ago

Great idea on the video. So I wasn't even close :). Let me try an educated guess this time. You want the initial state of your repeater section to have ZERO rows, instead of how it defaults to one row?

isaac Ruiz replied 7 months ago

Correct!

Victor Font answered 7 months ago
There is the frm_repeat_start_rows that will allow you to set the number of rows you want to see. I just tested this hook and set the start rows to 0. It also removes the add and remove buttons because they are part of the row. What you want to do isn't possible without custom code.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right