[jQuery] [autocomplete] Show autocompletelist when image is clicked
Hi,
I would like to emulate an editable selectbox.
There is an inputbox that has autocomplete and next to it is an image.
I would like to show the (complete) autocompletelist of the inputbox
if you click on the image.
Is this possible? I could not find a solution on
http://docs.jquery.com/Plugins/Autocomplete#API_Documentation
Here is a short testscript:
<head>
<link rel="stylesheet" type="text/css"
href="jquery.autocomplete.css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.autocomplete.js"></
script>
<script type="text/javascript">
$().ready(function() {
var adata = ['aa','ab','abc','ad','ae'];
$('#testid').autocomplete(adata);
});
function showAutocomplete(){
//$('#testid').search(); //does not work..
//$('#testid').show();
}
</script>
</head>
<body>
<input type=text id="testid"><img src="arrow-select.gif"
onclick="showAutocomplete();" style="cursor:pointer;width:16px;height:
18px;">
</body>