laural4705
Programmer
I am new to javascript - I found the perfect script and need to tweak just a bit: it is an autosuggest script that gives the next word based on the last letter typed. It works fine, no errors. The list that it uses for suggestions is about 600 entries long (so far) - I would like to automatically generate the list from my database (Filemaker) - right now it is manually exported and statically placed in the page. Could anyone share with me how I would go about getting the dynamic content in the page? I am familiar with PHP and thought maybe I could use some sort of include or pointer file? I just don't know... Here is the code, thanks for helping 
/**
* Provides suggestions for usernames.
* @class
* @scope public
*/
function StateSuggestions() {
this.states = [
"albert",
"bob",
"carol",
"cathy",
"melissa",
}
/**
* Request suggestions for the given autosuggest control.
* @scope protected
* @param oAutoSuggestControl The autosuggest control to provide suggestions for.
*/
StateSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/) {
var aSuggestions = [];
var sTextboxValue = oAutoSuggestControl.textbox.value;
if (sTextboxValue.length > 0){
//search for matching states
for (var i=0; i < this.states.length; i++) {
if (this.states.indexOf(sTextboxValue) == 0) {
aSuggestions.push(this.states);
}
}
}
//provide suggestions to the control
oAutoSuggestControl.autosuggest(aSuggestions);
};

/**
* Provides suggestions for usernames.
* @class
* @scope public
*/
function StateSuggestions() {
this.states = [
"albert",
"bob",
"carol",
"cathy",
"melissa",
}
/**
* Request suggestions for the given autosuggest control.
* @scope protected
* @param oAutoSuggestControl The autosuggest control to provide suggestions for.
*/
StateSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/) {
var aSuggestions = [];
var sTextboxValue = oAutoSuggestControl.textbox.value;
if (sTextboxValue.length > 0){
//search for matching states
for (var i=0; i < this.states.length; i++) {
if (this.states.indexOf(sTextboxValue) == 0) {
aSuggestions.push(this.states);
}
}
}
//provide suggestions to the control
oAutoSuggestControl.autosuggest(aSuggestions);
};