this part of my JS
var records=response.split('|');
for (i=1; i<records.length; i++) {
var record=records[i].split('*');
var region=record[0];
var regionid=record[1];
var x=document.createElement('option');
x.text=region;
list.options.add(x);
}
when it gets to the for loop, it never runs the stuff between { }
records is
0: "<option value='Bobs Dock'>Bobs Dock</option><option value='Johns Dock'>Johns Dock</option><option value='Mikes Dock'>Mikes Dock</option>"
length: 1
response is
"<option value='Bobs Dock'>Bobs Dock</option><option value='Johns Dock'>Johns Dock</option><option value='Mikes Dock'>Mikes Dock</option>"
so why does it not run the items between { }?
EDIT********
when changed to 0 so it does run, it will now make the drop box option say
<option>
"<option value='Bobs Dock'>Bobs Dock</option><option value='Johns Dock'>Johns Dock</option><option value='Mikes Dock'>Mikes Dock</option>"
</option>
What instead it should do is break each of the options into there own option for the drop down box.
1is equal to1, not less than it. Your loop will never execute. You may want to setito0, or the<to=... or just remove the condition entirely if it will always be met.