Problem in jquery enter key event

droopz001

New Member
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.phpThere is no button to search, hitting enter key only will give searched user.I writ my code in jquery as:\[code\]$(document).ready(function(){ $('#srchtxt').bind('click', function(){ if($('#srchtxt').val() != '') { $('#loading').html('<img src="http://stackoverflow.com/questions/3828277/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'); } }); });\[/code\]This event is not working. can you help me here?
 
Back
Top