Forum
Topic RSS
02:37
21/09/2011
OfflineHello,
I'm trying to figure out how to have my single search form submit when the enter button is pressed. I've found several posts regarding this, but the code doesn't work for me. I've tweaked the code I found, as seen below. But this code doesn't work properly. It seems that when I press the enter key, the form is submitted as if there was nothing entered in the value field. If I manually press the search button with the mouse pointer, it submits fine, but the jquery .click() method doesn't submit it properly, for whatever reason. I was hoping one of you might be able to give me some pointers here. Thanks!
Edit: The weird thing is, if I put an alert right before the .click() event, the alert pops up and the search works properly. But without the alert, just a '0' is submitted...
beforeShowSearch: function(form){
$('input', form).keydown(function(e) {
if (e.keyCode == 13) {
$("#fbox_cust_grid_search").click();
}
}
},
onClose: function(form){
$(form).unbind('keydown');
}
Most Users Ever Online: 994
Currently Online:
17 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66
Log In
Home