You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Struts Two <st...@yahoo.ca> on 2008/05/26 23:58:08 UTC

How to get autocomplete value in Javascript

I have the following two lines in my JSP:
<script language="JavaScript">function
elem = document.getElementById('host')"hostvalue "+ elem.value);</script>
alert(
}systemLookup(){
<s:autocompleter name="host" id="host" theme="ajax" href="/ccol/ticket/ajaxHosts.action" cssStyle="width: 300px;" autoComplete="true" loadOnTextChange="true" loadMinimumCount="1" showDownArrow="false"/> The javascript function fails for autocomplete Id, However; anyother if I put it to anyother form id element in my jsp it works. I have also tried:
document.getElementById('hostKey');
Using prototype API, I also tried the following:
alert($F('host'));
alert($F('hostKey'));
All of them fail. How can I retireve this value in a javascript.<span class="button-blue"><input type="button" value="Go" onclick="systemLookup();"/></span>


      __________________________________________________________________
Get a sneak peak at messages with a handy reading pane with All new Yahoo! Mail: http://ca.promos.yahoo.com/newmail/overview2/