jollykh
asked on
Accessing hidden variable in parent frame
Hello,
I have a frame that encompasses two other frames: a top frame and a bottom frame. I need to access a hidden variable in the bottom frame. How can I do that? Here's what I'm trying but i keep getting an error message:
top frame:
<script language="javascript">
function test()
{
if(true)
{
alert(parent.positions.doc ument.form s["order_p ositions"] .test.valu e);
return false;
}
}
</script>
bottom frame:
<form action="something.do">
name="order_positions"
method="post"
target="_parent">
<input type=hidden name=test value="test">
</form>
I have a frame that encompasses two other frames: a top frame and a bottom frame. I need to access a hidden variable in the bottom frame. How can I do that? Here's what I'm trying but i keep getting an error message:
top frame:
<script language="javascript">
function test()
{
if(true)
{
alert(parent.positions.doc
return false;
}
}
</script>
bottom frame:
<form action="something.do">
name="order_positions"
method="post"
target="_parent">
<input type=hidden name=test value="test">
</form>
Make sure that the for and it's fields are alredy loaded before accessing them.
Take a look on this ...
https://www.experts-exchange.com/questions/20913872/Hidden-Variable-and-Javascript.html
Take a look on this ...
https://www.experts-exchange.com/questions/20913872/Hidden-Variable-and-Javascript.html
You can try
parent.positions.document. getElement ById("test ").value
-Michael
parent.positions.document.
-Michael
ASKER
Ok, I think that this is going to be a little too difficult becuase there are frames within frames within frames. Let me ask this question, becuase there are so many frames embedded in each other, is there a way that I can reload or refresh only the current frame that I'm in?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
alert(parent.positions.doc
And in the upper snippet you have a closing > to ealy in the form tag. I hope this is a transcriptopn error.