jQuery(document).ready(function($){
$('.myclass').keyup(function(eventObject){
console.log("!")
var searchTerm = $(this).val();
if(searchTerm.length > 2){
if(eventObject.keyCode == 13){
$('#sendform input[name="s"]').val(searchTerm);
$("#sendform").submit();
return;
}
$.ajax({
url : '/wp-admin/admin-ajax.php',
type: 'POST',
data:{
'action':'',
'term' :searchTerm
},
success:function(result){
} });
}
});
jQuery(document).ready(function($){
$('.myclass').keyup(function(eventObject){
console.log("!")
var searchTerm = $(this).val();
if(searchTerm.length > 2){
if(eventObject.keyCode == 13){
goSubmit(searchTerm);
return;
}
$.ajax({
url : '/wp-admin/admin-ajax.php',
type: 'POST',
data:{
'action':'',
'term' :searchTerm
},
success:function(result){
} });
}
function goSubmit(searchTerm){
$('#sendform input[name="s"]').val(searchTerm);
$("#sendform").submit();
} });
});
$("#myid").val(/* тут val из поля из заголовка */);
str == null || str.length == 0