Scriptaculous Autocomplete to activate when the page is loaded.
Posted
by Jelle
on Stack Overflow
See other posts from Stack Overflow
or by Jelle
Published on 2010-05-13T18:27:26Z
Indexed on
2010/05/13
20:54 UTC
Read the original article
Hit count: 287
Is there a way to fire up Scriptaculous's Autocomplete to search with the default word from the inputfield when the page is loaded?
Something like this?
<input type="text" id="autocomplete" class="autocomplete_input" name="autocomplete_parameter" value="friends"/>
<span id="indicator1" style="display: none">
loading
</span>
<div id="autocomplete_choices" class="autocomplete">
</div>
<script type="text/javascript">
function AutoComp() {
var myAutoCompleter = new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "url", {indicator: 'indicator1',});
}
document.onLoad = AutoComp.activate();
</script>
© Stack Overflow or respective owner