Hi bobmijwaard ,
Given that this is likely to be a long list I'd take a slightly different approach and use PHP to manage the data from the start. Here's an example where I've put the data into an array - in practice I'd use a database table and some extra forms to manage the table.
The Form HTML is
<?php
if ( !$mainframe->isSite() ) { return; }
$product_array = array();
$product_array['1']['id'] = "A1";
$product_array['1']['naam'] = "Italiaans brood met kruidenboter";
$product_array['1']['prijs'] = 3.00;
$product_array['1']['beschrijving'] = "";
$product_array['2']['id'] = "A2";
$product_array['2']['naam'] = "Cocktail al gamberetti";
$product_array['2']['prijs'] = 7.00;
$product_array['2']['beschrijving'] = "Garnalencocktail van noorse garnalen met whiskysaus";
$product_array['3']['id'] = "A3";
$product_array['3']['naam'] = "Carpaccio di salmone ";
$product_array['3']['prijs'] = 8.00;
$product_array['3']['beschrijving'] = "Plakjes gerookte zalm met Parmezaanse kaas, ui grof gemalen peper en rucola";
$options = "";
$options .= "<option value=''>0</option>";
foreach (range(1, 10) as $n ) {
$options .= "<option value='$n'>$n</option>";
}
echo "<table>";
foreach ( $product_array as $k => $p ) {
echo "<tr>";
echo "<td><select name='q[".$p['id']."]' id ='q_".$p['id']."'>
$options
</select></td>";
echo "<td>".$p['id']."</td>";
echo "<td><strong>".$p['naam']."</strong><br />".$p['beschrijving']."</td>";
echo "<td>€ ".$p['prijs']."</td>";
echo "</tr>";
}
echo "</table>";
?>
<input type='submit' name='submit' />
NB I've left out the address fields here and I haven't bothered with the formatting. This generates a form very similar to yours. But all the quantity data is returned in a single data array like q = array( A1 => 0, A2 => 4, . . .
Important: to stop ChronoForms messing with the array you must set "ChronoForms handle my posted arrays:" to 'No'
The corresponding OnSubmit Before code is
<?php
// include the same product_array here !!
$q = JRequest::getVar('q', array(), 'post', 'array');
$output = array();
foreach ( $product_array as $p ) {
if ( $q[$p['id']] ) {
$output[] = $q[$p['id']]. ' : '.$p['naam'];
}
}
$output = implode('<br />', $output);
JRequest::setVar('output', $output);
?>
You can then add {output} into the Email template and the result is like:
5 : Italiaans brood met kruidenboter
3 : Carpaccio di salmone
Bob