i wants to submit a php form with any of function key or a Any of keyboard shortcut key.
I try following code. In that i do operation using keyboard keycode. but its not submits the form. Press "TAB" button from Keyboard
document.onkeydown=function(evt){
var keyCode = evt ? (evt.which ? evt.which : evt.keyCode) : event.keyCode;
if(keyCode == 9)
{
//your function call here
document.test.submit();
alert("Key Pressed");
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<?php
if(isset($_POST['search']))
{
echo $search = $_POST['search'];
}
?>
<body>
<form name="test" action="#" method="POST">
<input type="text" name="search" />
</form>
</body>
I wants to submit a PHP form with any of Function key or Any of combinations or shortcut key. So How can I do it with JQUERY,JS,AJAX OR PHP.