<script>
[green]//Object template to store the extra data[/green]
function objFields(city,state,zip){
this.city = city;
this.state = state;
this.zip = zip;
}
[green]//Function to fill the other form fields[/green]
function fillFields(i){
document.formName.city.value = selectArray[i].city;
document.formName.state.value = selectArray[i].state;
document.formName.zip.value = selectArray[i].zip;
}
var selectArray = new Array();
[COLOR=black yellow]<%[/color]
[green]'ASP to fill a JavaScript array with objects
'that hold the extra data[/green]
If Not rsSelectOptions.BOF Then
rsSelectOptions.MoveFirst
End If
Do While Not rsSelectOptions.EOF
Response.Write "selectArray[selectArray.length]=new objFields('"
Response.Write Replace(rsSelectOptions.Fields("City")&"","'","\'")
Response.Write "','"
Response.Write Replace(rsSelectOptions.Fields("State")&"","'","\'")
Response.Write "','"
Response.Write Replace(rsSelectOptions.Fields("Zip")&"","'","\'")
Response.Write "');" & vbCrLf
rsSelectOptions.MoveNext
Loop
[COLOR=black yellow]%>[/color]
</script>