Click to See Complete Forum and Search --> : Tab indexing in <img src=...>


a_neelima
01-10-2005, 04:15 AM
I have a HTML page with two buttons "save" and "cancel". These save and cancel buttons are not standard buttons. But instead I used my own buttons which are images. And I implemented "OnClick", "Onmouseover", etc for those images.

Now, the problem is when I am navigating using tab key, there is no tab stop on these two buttons.

I have read in the online tutorials that img src does not support tab index. Now what am I supposed to do?

And also I fixed my problem changing from img src to <input type="image" src="....

Now I want to know if the two ways of implementations are the same and if not what could be the possible problems that I would face.

Thanx in advance.
Neelima

pj59
01-10-2005, 06:43 AM
Hello!

You have to be aware of the fact that <input type=image> is a submit button. If you simply want some code to be executed when it is clicked, you will have to avoid the submission of the form. The other thing is: <img src=...> is not a form element, so you have to handle the passing of form objects or form element objects as arguments in a different way than you could using the <input type=image>.

Regards PJ

pj59
01-11-2005, 11:07 PM
Hi!

Forgot to mention that (if the only thing you are dissatisfied with concerning your buttons is the missing tab indexing) you can simply put your <img> tags in anchors and attach the event handlers to the <a> tags. They would be tab indexed depending on their position between (or above/ below) the form fields.

Regards PJ