Solved

java script image map problem

Posted on 2000-04-28
2
169 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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 overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

705 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