Forums

problem with email template and variable name

Borox 16 Feb, 2012
Hi,

I've used a custom Element to generate a list of input depending on the number of records of a table ( a list of products).
The purpose is to allow people to ask for a quotation for a quantity for all the products ( diplayed on 2 columns).

The forms works great, thanks ChronoForms, but I can't retrieve the values of the custom input in the email template because of the name of the input. I've generated a unique name for each input but the email template doesn't seem to like that...

Here is the generation of the input:
<?php
echo '<input maxlength="2" name="qte'.$i.'" type="text" style="width:30px"/>'
?>


It seems impossible to get the variable name (qte1, qte2....) in the email template, there I get:
<?php
echo '{qte}'
?>

Is there a solution to get the values generated by the forms in this case?

Thanks for your help.

Nicolas

I use JoomlaV1.7 / ChonoForms 4.0RC3.11
GreyHead 18 Feb, 2012
Hi Borox,

You can't use the curly brackets syntax inside PHP so instead you have to use the $form->data array
<?php
echo $form->data['qte'.$i];
?>

Bob
Borox 18 Feb, 2012
Thanks very much Bob, it works🙂

Regards.

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