Hi there, I need a little of your help here.
In my case I am having search textbox on b.php, in which user can enter username and hit enter to get the serched user-details. Ok this is so far. Now my search code to deal with database is ready in c.php and i want to call it through b.php with jquery's event. actuaully my a.php is home file and calling b.php through it on click event. Now flow for jquery will be like this a.php > b.php > c.php
There is no button to search, hitting enter key only will give searched user.
I writ my code in jquery as:
$(document).ready(function(){
$('#srchtxt').bind('click', function(){
if($('#srchtxt').val() != '') {
$('#loading').html('<img src="images/ajax-loader(1).gif">');
$('#loading').show();
$.get('/usersearch.php?tnm3='+arr3, '', function(data){
$('#content').html(data);
$('#loading').hide();
});
}
});
$('#srchtxt').bind('keyup', function(e){
if(e.keyCode==13) {
$("#srchtxt").trigger('click');
}
});
});
This event is not working. can you help me here?