Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

mouseover form info in different frame

How do I point mouseover text information to a form in a different frame?  I'm just using a simple info box ( onMouseover="document.navigateform.navigatetext.value='HISTORY'" ) and would like to put the form in a different frame.
0
yfcbdn
Asked:
yfcbdn
  • 3
  • 3
1 Solution
 
bernfarrCommented:
First of all, this is a JavaScript question.

To do this you need to know which frame you are using. Then you simply do:
  onMouseOver="Window.frames[X].document.formN.textM.value='Val'"

for X, formN, textM, substitute your values.

0
 
yfcbdnAuthor Commented:
That's what I thought, but it gives a "window undefined" error.  Here's the line...

onMouseover="Window.frames[opentopright].document.navigateform.navigatetext.value='HISTORY'

It works properly when the form is on the same page (minus the 'window.frame[x]').  But it returns the error when I try to point it to another frame (named: opentopright).


0
 
bernfarrCommented:
If your frame is called opentopright, the HTML should look like:
  <FRAME NAME="opentopright" ... >

then you should be able to simply use:
onMouseover="Window.opentopright.document.navigateform.navigatetext.value='HISTORY'

The frame itself becomes a property of the parent Window object.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
yfcbdnAuthor Commented:
yep, but it still returns an "undefined window".  The two frames are in different framesets from each other, but I tried moving the form to a frame in the same set - still had the same error. Not sure what I am missing.  I am using Frontpage.  Here is the url.

www.yfccanada.com/testopen.htm
0
 
bernfarrCommented:
OK, I played with it for a while. Be aware the Netscape and IE can forgive different errors. It's best to be aware of the JavaScript object hierarchy and be very specific about what you want to access.

Change your OnMouseOver and OnMouseOut to the following and it will work:
onMouseover="parent.opentopright.document.navigateform.navigatetext.value = 'HISTORY'" onMouseout="parent.opentopright.document.navigateform.navigatetext.value=''"

Note that I added the document object to the hierarchy. I've tested it with Netscape 4.04 and IE 4.0 (both on NT) and it works fine in both. You should also check it in other versions, but I think it'll be fine.
0
 
yfcbdnAuthor Commented:
Fantastic.  Thanks a lot for your patience and help.  I really appreciate it!


Regards

mark
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now