Forums

ad data to email template based on field id

groffi 28 Aug, 2013
I have text boxes with the same field name (to use 'combo' box input).
I want to receive all of their values in an email but because the field name is the same if i put {field_name} at the template i only receive the first text box's value.
Is there a way to receive the value of a text box by linking their Field ID instead of their Field Name at the email -> Template?

<table cellpadding="5" cellspacing="5" border="0">
	<tr>
		<td colspan='2'>
			<p> </p>
<p><span style="font-size: x-large;">Transfer from Naples Airport to Sorrento</span></p>
<p>Airport pick-up informations:<br>

<ul>
<li><strong style="line-height: 1.3em;">Departure point </strong><span style="line-height: 1.3em;">After you have picked up your luggage, the driver will meet you outside the Customs Area, at the Arrivals Hall. The driver will be holding a sign with your  name.</span></li>

<li><span style="line-height: 1.3em;">Private door-door transfer between Naples Airport and your centrally located Sorrento hotel</span></li>


<li><strong style="line-height: 1.3em;">Departure time </strong><span style="line-height: 1.3em;">Your chosen time (transfers operate 24 hours a day, 7 days a week)</span></li>
<li><strong style="line-height: 1.3em;">Duration </strong><span style="line-height: 1.3em;">Approximately 60 minutes</span></li>
</ul>


<p>Airport pick-up include:<br>

<ul>
<li><span style="line-height: 1.3em;">Meet and greet by a professional driver</span></li>
<li>One way private transfer</li>
<li>Transfer will be in a private vehicle</li>
</ul>

</p>
		</td>
	</tr>
	<tr>
		<td>
			<strong>Select number of passengers</strong>
		</td>
		<td>
			{car}
		</td>
	</tr>
	<tr>
		<td>
			<strong>Surname/Family name</strong>
		</td>
		<td>
			{family}
		</td>
	</tr>
	<tr>
		<td>
			<strong>Select date</strong>
		</td>
		<td>
			{date}
		</td>
	</tr>
	<tr>
		<td>
			<strong>Email address</strong>
		</td>
		<td>
			{email}
		</td>
	</tr>
	<tr>
		<td>
			<strong></strong>
		</td>
		<td>
			{}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Select number of passengers</strong>
		</td>
		<td>
			{car}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Select date</strong>
		</td>
		<td>
			{date_page2}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Surname/Family name</strong>
		</td>
		<td>
			{family_page2}
		</td>
	</tr>
	<tr>
		<td>
			<strong>Forename/Given name</strong>
		</td>
		<td>
			{given}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Email address</strong>
		</td>
		<td>
			{email}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Pick Up</strong>
		</td>
		<td>
			{pickup}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Pick Up City</strong>
		</td>
		<td>
			{pickup_city}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Hotel name & address</strong>
		</td>
		<td>
			{pickup}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Pick Up Location</strong>
		</td>
		<td>
			{pickup}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Cruiser name</strong>
		</td>
		<td>
			{pickup}
		</td>
	</tr>
	<tr>
		<td>
			<strong>Flight number</strong>
		</td>
		<td>
			{pickup}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Pick Up Time</strong>
		</td>
		<td>
			{pickup}
		</td>
	</tr>
	<tr>
		<td>
			<strong>Contact</strong>
		</td>
		<td>
			{contact}
		</td>
	</tr>
	<tr>
		<td>
			<strong>Cellphone</strong>
		</td>
		<td>
			{contact}
		</td>
	</tr>
	<tr>
		<td>
			<strong>Alternative email address</strong>
		</td>
		<td>
			{contact}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Drop Off</strong>
		</td>
		<td>
			{dropoff}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Drop Off City</strong>
		</td>
		<td>
			{city}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Hotel name & address</strong>
		</td>
		<td>
			{dropoff}
		</td>
	</tr>
	<tr>
		<td>
			<strong>*Drop Off Location</strong>
		</td>
		<td>
			{dropoff}
		</td>
	</tr>
</table>


as you can see some have the same name as {contact}. But they DO have different IDs like {contact_other} or {contact_cell}
GreyHead 29 Aug, 2013
Hi groffi,

If you have several form inputs with the same name then only the value of the last one will be returned when you submit the form.

You have two choices: you can use array names like contact[] - then you will get an array of values returned; or, as you suggest, you can give each input a different name either like contact_other, contact_cell, etc.

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