detect enter button pressed using .keypress event in jquery
===

I have web application in which i populate multiselectlistbox using items from database on page load.

I get the all items from listbox that are selected but they are in order in which they populated. 

I want these items to be in the order that they are selected by user.

so for this problem i found solution using client side `.click()` event on listbox as i detect selcted item and keep it's value in hiddenfield.This works well too,but the problem come when user press enter key insted of mouse click for selecting item. At this time it does not fire .click() event  so i have used 
`onkeypress()`,`onkeyup()` but it doesnt fire at all

Here is my code :

    <script type="text/javascript">
        $(document).ready(function() {
                    $(".chzn-results .active-result").click(function(event) {
        
                          
                        var hdfld = document.getElementById("hdn_menuitems");
                        if (hdfld.value == "") {
                            hdfld.value = $(this).index();
                        }
                        else {
                            hdfld.value = hdfld.value + "," + $(this).index();
                        }
        
                      
                    });
         $(".chzn-results .active-result").keydown(function(event) {
                    $(".chzn-results .active-result").keyup(function(event) {
        
                       
                    alert("Event");
                    if(event.keyCode==13)
                    {
        
                        var hdfld = document.getElementById("hdn_menuitems");
                        if (hdfld.value == "") {
                            hdfld.value = $(this).index();
                        }
                        else {
                            hdfld.value = hdfld.value + "," + $(this).index();
                        }
                        
                    }
                    });
                });
    
    </script>


This is my listbox:

    <asp:ListBox ID="dr_menuitem" runat="server" class="chzn-select" style="width:575px;" SelectionMode="Multiple" >
    		            <asp:ListItem></asp:ListItem>
    		       </asp:Listbox>

I have used listbox using [http://harvesthq.github.com/chosen/][1]