UPDATE: If you're looking for the solution that will work in FireFox & IE...Go
here
Okay, I admit, this is yet another post so I know where to go in 3 months when I totally forget this day.
Long story short: I was trying to use the DefaultButton property on a panel in order to get a button clicked by default when a user hits enter on my search form. I was using an ImageButton, and surprise! That won't freakin' work! Seriously...try it.
I came across a post on here ( http://bytes.com/forum/thread288545.html ) from S. Justin Gengo. With a link to his site.... http://www.aboutfortunate.com/Code-Repository.aspx?entryid=14
And booya, his simple JS code works perfectly in IE6/7 & FF.
Good day, sir.
ps - Thank you Justin
___
tbSearchBox.Attributes.Add("onkeydown", _
"javascript:if((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)){document.getElementById('" _
& btnSearchButton.ClientID & "').click();return false;}else return true;")
Print | posted on Thursday, July 31, 2008 3:08 PM