HighDots Forums  

Passing Values Between Frames

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Passing Values Between Frames in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
 
Posts: n/a

Default Passing Values Between Frames - 12-10-2005 , 04:28 PM






Hi,
1st, I did a search and could not find any info on this, the Google results
were good, but I'm still have issues...So any help will be great.
I have a frame page, which contains 3 frames (Left, Content, and Footer)

In the content page, I have a checkbox, which value is a number (i.e. 500).
I would like that, when a user clicks on this checkbox, it will send the
value to my LEFT frame.
My left frame has an array, where I'm going to keep track of these
numbers, and then display the total.
I'm at the point were I can send the value to the left frame but only using
'parent.left.document.write.(user_input)
I can't send the value to another variable in the left frame nor can I
reference the variable (content frame) from the left frame side

below is part of my code... I hope this helps.
//FRAME PAGE
<frameset cols="110,*" border="0">
<frame src="nav.html" name="left"/>
<frameset rows="*,50">
<frame src="mainpage.html" name="content"/>
<frame src="footer.html" name="footer"/>
</frameset>
</frameset>
------------------------------------------------------------------
//ARRAY ON NAV page

var numb = new Array();

numb[0] = "0"
numb[1] = "0"
numb[2] = "0"
numb[3] = "0"
numb[4] = "0"
numb[5] = "0"
numb[6] = "0"
numb[7] = "0"
numb[8] = "0"
numb[9] = "0"

var total = parseFloat(numb[0]+parseFloat(numb[1]+parseFloat(numb[2]...etc
------------------------------------------------------------------------

THE CONTENT PAGE WHERE I WILL BE GETTING THE VALUES FROM to pass to the NAV
page

<form name="cartform" action="#">
<input type="checkbox" value="500" name="option1"
onclick="checkedbox(this)" />Add to Cart
</form>

<script type="text/javascript">
function checkedbox(userfield){
{
if (document.cartform.option1.checked)
{
user_input =
parent.content.document.cartform.option1.value
parent.left.document.write(user_input)
}
}
}
</script>

I'm really stuck here, I've tried all kinds of calls, and keep getting the
same error (value is null or not a an object)\
Any help would be greatly appreciated...

Thanks
Joe D.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.