Jquery: Inputbox onEnter Event to Click

 

Jquery: Inputbox onEnter Event to Click

 

JS File:

 

function onTableSearchEnter(){

$(“#table_search_value”).bind(‘keypress‘, function(event) {

    if (event.keyCode == “13”) {

        $(“#btn_table_search”).click();

    }

});

};

 

function onEnterToClick(_input_id,_button_id){

$(_input_id).bind(‘keypress‘, function(event) {

    if (event.keyCode == “13”) {

        $(_button_id).click();

    }

});

};

 

 

Call in frontend Html:

<!– Backend
Admin Page –>

<!doctype html>

<html>

<head>

<title>User</title>

<!– Import JQuery –>

<script
src=“../script/jquery-3.5.1.min.js”></script>

<script
src=“../script/bootstrap.min.js”
></script>

<script
src=“../script/jquery.treeview.js”
></script>

<script
src=“../fontawesome-free-5.14.0-web/js/all.js”
></script>

<script
src=“../script/common.js”></script>

 

<!– Import CSS –>

<link
rel=“stylesheet”
href=“../css/bootstrap.min.css”
/>

<link
rel=“stylesheet”
href=“../css/jquery.treeview.css”
/>

<link
rel=“stylesheet”
href=“../css/global.css”
/>

<link
rel=“stylesheet”
href=“../fontawesome-free-5.14.0-web/css/all.css”
/>

 

<!– Current Page CSS Style –>

<style>

caption {

text-align: left;

caption-side: top;

}

</style>

 

<!– Current Page Script Action –>

<script>

$(document).ready(function(){

//===> Begin

tableSelectAll(“#tbody_01”);

onTableSearchEnter();

//<===End          

});

</script>

</head>

<body>

Leave a Comment