I am expanding the dropdown on focus which is same as clicking on the dropdown and selecting an option.
<script type="text/javascript">
$(document).ready(function () {
$('#<%= ddlNature.ClientID %>').focus(function () {
$('#<%= ddlNature.ClientID %>').attr('size', 6);
});
$('#<%= ddlNature.ClientID %>').focusout(function () {
$('#<%= ddlNature.ClientID %>').attr('size', 1);
});
});
</script>
<asp:DropDownList ID="ddlNature" runat="server" class="text" TabIndex="5">
The dropdown expands on focus but the option selected from the dropdown does not get selected ie. the expanded dropdown does not function as dropdown. I am not getting the value selected when i inspect in the firebug.
When I set AutoPostBack to true of the dropdownlist, I get the dropdown value but I don’t want to refresh the page.
Thanks,
The code is just fine..
Firebug does not display the select changes..
If you attach a change handler you will see that it does change it indeed..
See demo http://jsfiddle.net/gaby/vxDrE/