<input type="image" default focus on enter key press on a web page

  • Thread starter Thread starter bvarun2007
  • Start date Start date
B

bvarun2007

Guest
I have an aspx page where I have an image as an input type to open pop ups.
I set it to (<input type="image") because the tab focus was not going to the info icon if img was used instead.





<inputtype="image"id="Imageqq1"

src="images/Info_Icon.gif"runat="Server"onclick="Popupopen(); returnfalse;" />



This fixed my issue with the tab order, but now if we click anywhere on the web page(empty div) and press enter key. its firing the onclick event of this input image. Expected behavior is that nothing should happen on enter press until I set the focus to the info icon.

Please dont ask me to change it from input type="image" as I have already implemented this in many places.

Continue reading...
 
Back
Top