Search button click w/ enter key

This should be a relatively easy one. Could you make the enter key click the the Search button on the roller coaster & parks search?

I have code that will do this in .net, but it is vb code. I believe it is just 1 line of VB code you need to set & a few lines of JS (if there is no underlying reason why this funciton should happen). Here is the code i have written (my javascript aint the best, but it works)...

-=VB=-
txtSearch.Attributes.Add("onkeypress", "testEnterKey('btnSubmit');")

-=Javascript=-
function testEnterKey(buttonToClick)
{ if (event.keyCode == 13)
{ event.cancelBubble = true;
event.returnValue = false;
document.all.btnSearch.click(); } }

Jeff's avatar
The underlying reason has to do with control validation across many form elements on various pages, since the search box appears often with other things like logins, forums, other searches, etc.

------------------
Jeff - Webmaster/Admin - CoasterBuzz.com - Sillynonsense.com
DELETED!

You must be logged in to post

POP Forums - ©2024, POP World Media, LLC
Loading...