I figured out how to get it work.
The problem was, that fields in the infowindow doesn't exit, when the
script is called first.
These objects are created when the infowindow is build, when one
clicks on the marker.
I added the eventhandler onChange = 'getautosuggest()' to the fruit
select into the infowindow and wrapped the creation of the autosuggest
into the function getautosuggest().
Now everything works fine.
Here the parts I've changed:
//Autosuggest field using FCBKcomplete
function getautosuggest(){
$(document).ready(function(){
$("#sort").fcbkcomplete({
json_url: "get_sort_json.php?
&fruit="+document.getElementById('fruit').value+"",
addontab: false,
maxitems: 20,
input_min_size: 1,
height: 10,
cache: false,
newel: false,
select_all_text: "select"
});
});
}
and:
var html="<form><table><tr><td>Fruit </td><td><select id='fruit'
onChange ='getautosuggest()'>"+
"<option selected value=''>select fruit</option>"+
"<option value='ap'>Apple</option>"+
"<option value='pe'>Pear</option>"+
"<option value='ch'>Cherry</option>"+
"</select></td></tr>"+
"<tr><td>Sort </td><td><input type='text'id='sort'/></td></
tr>"+
"<input type='button' value='Save' onclick='saveData()'/></
form>";
Maybe this can help someone else
Georges