title: Connecting a dojo Autocompleter to a javascript function
body: <p>I am trying to call a java script function when the selected value in a Dojo auto-completer is changed, but I am unable to do so.</p>
  
  <p>Firstly because the standard <code>onchange</code> attribute does not work here, as this is not a standard HTML component.</p>
  
  <p>Secondly I found this documentation ( <a href="http://dojotoolkit.org/reference-guide/quickstart/events.html#connecting-to-a-dom-event" rel="nofollow">http://dojotoolkit.org/reference-guide/quickstart/events.html#connecting-to-a-dom-event</a> ) and it is supposed to solve my problem. But somehow I am still not able to connect to a javascript function.</p>
  
  <p>Here is the sample page through which I am trying to test this out.</p>
  
  <p>The JSP: </p>
  
  <pre><code>&lt;s:form id="form"&gt;
      &lt;sd:autocompleter id="try" list="sampleList"/&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p>The JS File:</p>
  
  <pre><code>dojo.connect(dojo.byId("try"),"onchange", tryAlert);
  
  function tryAlert(){
      alert('successful');
  }
  </code></pre>
  
  <p>I don't know what I have interpreted wrong from the documentation.</p>
  
  <p>Please advise.</p>
  
  <p>Thanks!!</p>