Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Answers


Use parent search container div id selector to select all section and perform search on keydown event for that section.

Your code should be like following snippets,

//On enter key press search logic 
$("#dvProductSearchMain").keydown(function (e) {
    if (e.which == 13) {
        e.preventDefault();
        //Search products  
        ProductSearch();
    }
});
 
//on button click search
$("#btn-search").click(function () {
    //Search products  
    ProductSearch();
});
 
//common reusable search function
function productSearch() {
    //your search logic here
}

Share your answer


Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.