Click event on HTMLMapElement in C# does not work.

I have the following in a page:

<map name="ok"><area shape="rect" href="javascript:Enregistrer('OK')" coords="2,1,55,20" onmouseover='swapImage("ok","STD/ok2_EN.gif")' onmouseout='swapImage("ok","STD/ok_EN.gif")'></map> <img name="ok" src="STD/ok_EN.gif" usemap="#ok" alt="" border="0">

This is essentially the button the user clicks to submit a POST form instead of the standard <SUBMIT>.  I am trying to automate the clicking of this map by the following code:

            HTMLMapElement btnSearch = (HTMLMapElement)myDoc.all.item("ok", 0);

But this doesn't work.  It doesn't even seem like it is submitting the form.

James CochraneB2B FINTECH WRITER/Technology WriterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
The clickable parts of the map are the <area> tags, but you are grabbing a reference to the map itself.  I would think that you need a reference to the <area>.  Also, you have a <map> and an <img> with the same name--"ok".

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.