Solved

java script image map problem

Posted on 2000-04-28
2
165 Views
Last Modified: 2010-04-09
when you enter my and the mouse is over the image map that is linked to show text in a form you get an error but when you enter the page and the mouse is not over the image map it loads just fine. how do i fix it, you can view the page at http://209.161.209.101/market/right.htm
0
Comment
Question by:bjbmod
2 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 75 total points
ID: 2759977
The problem is that the form element you are modifying doesn't exist yet when you rollover it while it's still loading.  This causes an error since it can't find the object.  So you have to set a variable in the onLoad handler for the document.  This will ensure that it is loaded before trying to modify it.

onLoad="loaded=true"

Then in the map areas:
onMouseOver="if (loaded) theForm.out.value='SHOPPING'"

Also be sure to define loaded in the header:
<SCRIPT language="JavaScript">
<!--
var loaded = false;
// -->
</SCRIPT>
</HEAD>

This should fix it for you.
-Josh
0
 

Author Comment

by:bjbmod
ID: 2760224
I am happy, Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now