I have a form which has a multiple option selector in it:
<td>
<input type="checkbox" name="chk[]" checked="checked" />
</td>
<td>
<select id="loyaltyType" required="required" name="VX_TYPE[]">
<option>Choose Type</option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
</td>
<td>
<input type="text" required="required" class="small" name="VX_NAME[]">
</td>
<td>
<input type="text" required="required" class="small" name="VX_EMAIL[]">
</td>
<td>
<select name="VX_LOCATION[]" multiple>
<option value="London">London</option>
<option value="New York">New York</option>
<option value="Paris">Paris</option>
<option value="Tokyo">Tokyo</option>
</select>
</td>
I would like the form to print with the following input/output:
Input:
B, sample name, sample email, New York + Toyko selected
D, sample name2, sample email2, London + Toyko selected
Output:
B, sample name, sample email, New York, Tokyo.
D, sample name2, sample email2, London, Tokyo.
However the actual output I am getting is as follows:
Actual output:
B, sample name, sample email, New York.
D, sample name2, sample email2, Tokyo.
This is the code for the output so far that does not work:
<?php foreach($VX_TYPE as $a => $b){ ?>
<p>
<?php echo $VX_TYPE[$a]; ?>, <?php echo $VX_NAME[$a]; ?>, <?php echo $VX_EMAIL[$a]; ?>, <?php echo $VX_LOCATION[$a]; ?>
</p>
<?php } ?>
Any suggestions of how to get this working would be great!