Re: Dropping <input usemap="">

On 8/15/07, Lachlan Hunt <lachlan.hunt@lachy.id.au> wrote:
> Michael A. Puls II wrote:
> > The way Firefox handles <input usemap> is great. At the moment, I
> > can't think of one thing about its implementation that is wrong or
> > unexpected.
>
> Except that, as implemented, it provides none of the purported
> accessibility benefits, since clicking on an area of the client side map
> doesn't submit the form, it follows the hyperlink.  Submitting the form
> with a specific set of co-ordinates would be the only logical reason for
> wanting a client side image map on an input control designed for form
> submission.  If you want hyperlink image map, use img.

Yeh.  As an example, <
http://shadow2531.com/opera/testcases/imagemaps/002.html > shows how
you can use js to simulate <input usemap> with <img usemap> and still
get the X and Y coordinate form submission on non-mapped parts of the
image.

It basically uses an onclick handler with clientX, clientY, offsetLeft
and offsetTop to figure out the coordinates and sets the hidden x and
y inputs before submitting. The example is Opera, FF and Safari
friendly and could be made IE friendly probably.

So, using JS and <img usemap> might be an alternative to <input
usemap>. And, it might provide better support across browsers (as long
as you have JS on).

-- 
Michael

Received on Wednesday, 15 August 2007 22:24:26 UTC