I want to pass the value of jquery in PHP function is it possible to send the value. like for example I have a textbox and in textbox when the user add 5 then it instantly send to the php function after that when the user add 56 then the value is been send to the PHP function... I was trying but its not working for me.. my code is
<?php
$block->storeInAlgolic();
?>
<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function(
$,
modal
){
$("#order_search").keyup(function(){
var textinput = $('#order_search').val().substring(0,20);
<?php $block->getFromAlgolia('textinput'); ?>
var client = algoliasearch(textinput);
console.log(client);
$("#textbox2").val(textinput);
$("#textbox3").val(textinput);
});
});
</script>
<style>
input[type=number] {
width: 130px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
font-size: 16px;
background-color: white;
/*background-image: url('searchicon.png');*/
background-position: 10px 10px;
background-repeat: no-repeat;
padding: 12px 20px 12px 40px;
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
}
input[type=number]:focus {
width: 100%;
}
</style>
</head>
<body>
<p>Animated search form:</p>
<form type="POST">
<input type="number" id="order_search" name="searchh" placeholder="Search Order by Order_ID">
<br /><input type="text" id="textbox2"/><br>
<br /><input type="text" id="textbox3"/>
</form>
</body>
is there is any possible way to send Jquery instantly to php function?
