Forums

Email table display looping error

ltempest 12 Nov, 2021
Please help! :-)

I have a form whereby customers can dynamically add more items:

https://www.hunterpanels.com/wall-quote-form

Then in the email action I have this:

<tr style="background-color: #D9D9D9">
{var:loopproductname}
{var:loopproductquantity}
{var:loopproductprice}
{var:loopprocudtthickness}
{var:loopproductescalators}
</tr>

But it does not create separate rows for each additional entry and instead adds them all to the same table row which does not display correctly.

What do I need to change to have the email generate a new table row for each of them?

I have hopefully attcahed a backup of the form if that helps.

Thanks

Lee
ltempest 12 Nov, 2021
[file=www.hunterpanels.com/QuoteForm.zip]QuoteForm[/file]
healyhatman 12 Nov, 2021
What's the field name? I'm guessing you don't have square brackets at the end?
ltempest 12 Nov, 2021
Thanks for the reply, apologies I do not know what you mean, there are a number of indiviudal fields in a repeater action.
healyhatman 12 Nov, 2021
Yep but if you want the data in an array, and not just the last value from the last repeater, the name of the field needs to end in [].
ltempest 12 Nov, 2021
Healyhatman,

Thanks for your time, but I'm struggling!

Please view:

This image shows how I have the repeater and the fields setup.

Then the email comes through with this. Which shows the multiple repeated entries but not in separate rows.

I tried your advice and added to the end of the name but then the form does not send and gets stuck in a loop with an error stating no value was entered - see
this

My apologies, this is probably a simple fix but I just do not have enough understanding to work it out!

Thank you

Lee

Edited to correct links
GreyHead 14 Nov, 2021
Hi Lee,

I think that the problem is the way that you have set up the on Submit loop actions - as far as I can see each of these takes all the values for e.g. product_name and collates them into a string: <td>name1</td><td>name2</td> . . .

I think you probably need custom PHP to loop through the data and build a data item like this <tr><td>name1</td><td>quantity1</td> . . .

Bob
ltempest 15 Nov, 2021
Bob
Thanks for the reply, I undertsand what you are syaing, but unfortunately don't have the php skills to know how or what to code to create that custom php loop :-(

Lee
GreyHead 15 Nov, 2021
Hi Lee,

I'm up to my eyebrows at the moment but will see if I can work it out when I have a moment or six to spare.

Bob
ltempest 16 Nov, 2021
Greyhead,
Thanks you for your time, it is most appreciated. I'll certainly buy you a coffe! :-)

Lee
ltempest 19 Nov, 2021
Answer
After a lot of head scratching and failures, I finally got it working! I did lean heavily on this page

Whilst not exactly correct with the latest v6 it does give 95% of what you need!

Lee
You need to login to be able to post a reply.