Hi Everybody. Greetings For the Day... Here i am facing a problem in a HTML Document. In the Document i am having two text boxes and one image with some click event. when i am pressing enter key it fires the images click event eventhough the focus not in the image... here is the Code <td><input type='image' src='bbb.gif' onclick='doThis();'></td> when the focus is out of the image also the images click event was firing.. Did any one have any idea on this how to avoid this... Thanks in advance......!!!!!
I'm not the most proficient with js, but I think you are having this problem because by default, forms can be submitted by pressing the enter key, and submitting a form generates an onClick event. What you might want to do is disable the onClick (return false) and then instead of using onClick to trigger your event, use onMouseUp or onMouseDown.