Pass Variable from IFrame to Another Frame


I have an IFrame inside another frame. On the IFrame Page I have a drop box. When I select a value from the drop down box I want it to pas the value to the frame named contents.

<form target="contents" method="POST" action="Data.asp">
<select name="AnyYear" size="2" style="font-family: Arial; font-size: 10pt" onchange="this.form.action='';this.form.submit();">
Do While Not rs.EOF
<option value="<%=rs("AYear")%>"><%=rs("AYear")%></option>
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZvonkoSystems architectCommented:
"I want it to pas the value to the frame named contents."
Does you ask how to set some field in the form located in the "contents" frame page?

That would be like this:
<select name="AnyYear" size="2" onchange="parent.frames.contents.document.yourFormName.yourFieldName.value=this.value" >

RecipeDanAuthor Commented:

I am gettin this error message:

parent.frames.contents.document is null or not an object

<select name="AnyYear" size="2" onchange="parent.frames.contents.document.theForm.AnyYear.value=this.value" >

ZvonkoSystems architectCommented:
What browser do you use for testing?
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

RecipeDanAuthor Commented:
Internet Explorer 6.0
ZvonkoSystems architectCommented:
Then it has to work.
Show me please your frameset definition.
Also check wether this works:

<select name="AnyYear" size="2" onchange="" >

Especially look for exact target frame naming. It has to be: contents
Exact same name, all lowercase characters.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RecipeDanAuthor Commented:
Hi Zvonko:

I thought I closed this....any way it works.

Thanks for your help

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.