I am still trying to get my head around this.
You are correct in that my recordset had multiple instances of the same postcode, (to try and achieve something else), - so what I have done is created another map page with a simpler recordset, so I only have one row per postcode, in order to get this working, ..I can do the other bit later...
On my map2 page, I presently have 4 address rows returned from my recordset, and 4 map points.
The issue I am having is that the addresses are created on page load - from the recordset, so the form elements are not static.
My recordset is sorted by LocationID, so the order in which the address postcodes are loaded is as follows..
So in the infowindow form, when I change the values in the square brackets as shown, they appear to correspond to the form elements outlined in the table
Postcode LocationID Form Element
IP14 4PH 1 0
CO7 7HH 2 1
CO6 BQT 3 2
IP28 6TX 4 3
<input type='text' name='from' value=''/><input type='button' value='get directions' onclick='addDirections(this.form.elements[0].value, wagmp_map_2_obj.addresses[0].full,true,wagmp_map_2_obj.obj,wagmp_map_2_obj.icons[0],wagmp_map_2_obj.points[0]);' /></form>
eg when I change the values to [2], the directions will be from the entered postcode to CO6 BQT
and when I change the values to [3], the directions will be from the entered postcode to IP28 6TX
So do the form elements[0] and [1] etc also need to be created from within the loop index ?
I have tried replacing the numbers with variables, but it doesn’t work.
I have uploaded map2.php to my test site, map2.php


