Forum Moderators: open

Message Too Old, No Replies

Image map area title

Getting the value

         

Alternative Future

10:33 am on Oct 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Folks,

Any help on this is appreciated! Having a *very* stressful week and things are not going too well :)

I have an image map (Risk Matrix) that has a selection image move over the top of it with the cursor, the problem I am having is getting the value of the <area title="this value"> to be added to my hidden form element, a simple alert getting the value would be perfect so that I can proceed.

Many thanks,

-George

adni18

11:08 am on Oct 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<MAP>
<area title="Hello World!">
</MAP>
<input type=text>
<SCRIPT>
<!--
document.getElementsByTagName("input")[0].value=document.getElementsByTagName("area")[0].title;
//-->
</script>

Alternative Future

11:45 am on Oct 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello and thank you adni18,

How do I get it to the right array index depending on user click? document.getElementsByTagName("area")[0].title your example uses the first area title tag yeah?

Your help is really appreciated

-George

adni18

12:02 am on Oct 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



so you want to change the input value according to which area the user clicks on?