Note that there are some explanatory texts on larger screens.

plurals
  1. POValue not getting selected from an Autocomplete on Mouse button click
    text
    copied!<p>I have a <code>Jquery Autocomplete</code>. Its working fine. Values are selected when i move up and down from keyboard arrow key or hover a mouse on a particular value. But when i press button to put my selected value inside text box it doesn't work, instead if i press enter on keyboard the value is inputted in text box. </p> <p>Let me give me my <code>code</code> for auto complete :: </p> <pre><code>$(document).ready(function hello(){ var myVar2 = &lt;%=request.getAttribute("variable1")%&gt; $("input#assignedtoid").autocomplete({ source: myVar2 }); }); &lt;input dojoType="dijit.form.ValidationTextBox" id="assignedtoid" name="assignedtoname" required="true" onfocus="hello()" value=&lt;%=session.getAttribute("Username")%&gt; onblur="valassignedtoid()"&gt; </code></pre> <p>In above code <code>myVar2</code> is my data in <code>Json</code> form that is assigned a source for autocomplete. Values coming fine in autocomplete. <code>OnFocus</code> event in <code>input tag</code> i call <code>hello()</code> function. Why it is that value is not getting selected on <code>mouse button click</code>. However the site from where i picked up the code. the value is getting selected on Mouse click as well as on enter pressing. The <code>site</code> is :: </p> <pre><code>http://jqueryui.com/demos/autocomplete/ </code></pre> <p>Here the only diff is that there Source is static i am getting it from database in the form of <code>Json</code> thru <code>myVar2</code>. I am using IE. Using <code>dijit.form.ValidationTextBox</code> as my <code>input</code> </p> <p>Please help. Thanks .. </p> <p>The Edited Part :: </p> <p>i have Imported The following js files:: </p> <pre><code>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js"&gt;&lt;/script&gt; &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"&gt;&lt;/script&gt; </code></pre> <p>And when i run it in <code>Google chrome</code> i don't get any auto complete. I do get an <code>error</code> that ::</p> <pre><code>&lt;script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js"&gt;&lt;/script&gt; </code></pre> <p>is not found. And indeed its not valid anymore. But my auto complete works great when i run it on IE. Can this be the reason ? Also can u tell me which Jquery imports from the above i should delete if any of them is extra. Kinda confused. </p> <p>i have taken the code from here ::</p> <pre><code>http://jqueryui.com/demos/autocomplete/ </code></pre> <p>Thanks again. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload