I’m trying to open a JQuery UI Combobox when I click on it, basically what I want is this:
$("#auto").bind("focus", function () {
this.value = '';
$(this).autocomplete("search", '');
});
But in a combobox.
The problem is that Im not able to get the focus or click event to be trigger.
I’ve try the click and bind focus events on: the actual field, the input field created by jquery but none of them since to work.
How could I get this to worked in the JQueryUI ComboBox?
Update
I’ve just noticed that I get the event trigger when I open the options and mouse over the options. But again what I want is to trigger it when I click on the input part.
*CODE *
Razor Code
<div class="editor-label">
@Html.LabelFor(model => model.Lugar, "Nombre del Lugar")
</div>
<div class="editor-field">
@Html.DropDownList("Lugar", String.Empty)
@Html.ValidationMessageFor(model => model.Lugar)
</div>
JavaScript Code
$("#Lugar").combobox();
Events
$("#Lugar").click(function () {
alert("Handler for .click() called.");
});
$("#Lugar-input").bind("focus", function ()
{
alert("a");
});
Add when creating the input field in the click event a call to the function openMethod
Function Openmethod