Solved

Refering to a form in another Frame

Posted on 1997-03-12
1
239 Views
Last Modified: 2008-03-17
I have to Frames (A and B). Frame A contains a form. Now, i want to Change the Value of a field that is in this form from frame B.

Is this possible?

I thought it should be something like this:

document.frames[0].form[0].fieldname.value="BlaBla";

But it does not work.
0
Comment
Question by:stinnux
[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
1 Comment
 

Accepted Solution

by:
cherold earned 100 total points
ID: 1264991
To refer to a different frame, first you need to reference the top frame, like top.frames[0].document.forms[0].fieldname.value

Observe:
main.html:
<HTML><HEAD><TITLE>main</TITLE></HEAD>
<FRAMESET ROWS="50%,*">
<FRAME NAME="one" SRC="one.html">
<FRAME NAME="two" SRC="two.html">
</FRAMESET>
</HTML>

one.html:
<HTML>
<HEAD><TITLE>one</TITLE></HEAD>
<BODY>
<FORM ACTION="" METHOD=GET>
<INPUT TYPE="text" NAME="test" VALUE="test">
<A HREF="#" onClick="document.forms[0].test.value='changed from one'">click</A>
</FORM>
</BODY>
</HTML>

two.html
<HTML><HEAD><TITLE>two</TITLE></HEAD>
<BODY>
<A HREF="#" onClick="top.frames[0].document.forms[0].test.value='changed value'">click here</A>
</BODY>
</HTML>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

738 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