Forums

multi row field doesn't work in email

dragolong 11 Jul, 2014
Hello, to everyone! with the help of this tutorial: http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2700-how-can-i-have-a-button-to-add-more-form-inputs.html

I crate a button that allow the user to add a new input in another row. Until this point there aren't problems... but now i need to use the datas in the mail and in the database table. How can i do that? i don't understand the last part of the tutorial...


Thank you!
GreyHead 12 Jul, 2014
Hi dragolong,

Which part exactly don't you understand?

Bob
dragolong 12 Jul, 2014
Thank you for your reply. I can't understand how to put in the mail the data inserted by user. For example if i have a text input whose alias is "name" in the template mail I write {name} to display the data inserted by user.

How can i display the data of multi row input in the mail?

Thank you!
GreyHead 12 Jul, 2014
Hi dragolong,

if i have a text input whose alias is "name" in the template mail I write {name} to display the data inserted by user
Yes that is correct.

How can i display the data of multi row input in the mail?
You do the same, but use the names you have given them. If it is an array then the names may be like {email.1}, {email.2} etc.

If you add a debugger action to your form then you can see what data is available to you.

Bob
dragolong 12 Jul, 2014
The debugger action doesn't display multirow input... I can't understand why....

THIS IS THE FORM: http://www.bionaturaitalia.it/index.php?option=com_chronoforms&chronoform=ordine_wellness

thanks!
GreyHead 12 Jul, 2014
Hi dragolong,

There's a typo in the PHP somewhere. Your form HTML looks like this for one of the inputs:
<input type="text" cod="ordine[1][COD]" id="ordine_1_COD">
that should be
<input type="text" name="ordine[1][COD]" id="ordine_1_COD">
with name= in place of cod=

Bob
dragolong 12 Jul, 2014
Thank you, now I try it!
dragolong 12 Jul, 2014
ok, now debugger works correctly, but I can't put the data in the mail... i tried cod.1, cod, cod1 but no one of these works.
GreyHead 12 Jul, 2014
Hi dragolong,

Here's an extract from the Debugger output
    [ordine] => Array
        (
            [1] => Array
                (
                    [COD] => aaa
                    [QT] => bbb
                    [PREZZO] => ccc
                )

            [2] => Array
                (
                    [COD] => xxx
                    [QT] => yyy
                    [PREZZO] => zzz
                )
From this you can see that the effective input names are like [ordine][1][COD] so the matching entry in the email template would be {ordine.1.COD}

Bob
This topic is locked and no more replies can be posted.