#1 (permalink)  
Old 06-05-2007, 11:24 PM
Registered User
 
Join Date: Jul 2004
Posts: 249
Hidden values problem

I'm trying to take values from the child pages through iframes into the parent or outside page and send it to a pop up (the JavaScript is in an external js file):

Code:
//JavaScript to be shared with program pages
var oreilly = new Array(); //to hold the answer from the user
function createOrder(){
	clickable=document.forms[0].check
	txt=""
for (i=0;i<clickable.length;++ i){
	if (clickable[i].checked){
		txt=txt + clickable[i].value + " "
		}
	}
document.getElementById("order").value="You ordered: " + txt
}	

function openpopup(){
	oreilly[0] = parent.parent.document.getElementById("gal1").value; //copies the user buyer to index.html hidden field  
	oreilly[1] = parent.parent.document.getElementById("gal2").value; //copies the user buyer to index.html hidden field  
	oreilly[2] = parent.parent.document.getElementById("gal3").value; //copies the user buyer to index.html hidden field  
	oreilly[3] = parent.parent.document.getElementById("gal4").value; //copies the user buyer to index.html hidden field  		
	oreilly[4] = parent.parent.document.getElementById("gal5").value; //copies the user buyer to index.html hidden field 


	var newwindow1 = window.open("../orderform.html", "polar_bear", "width=350, height=320");
	var tmp = newwindow1.document;
	tmp.write("You Ordered: ");


	
function photos_bought(clickable, bought){
	oreilly[0] = bought;
	parent.parent.document.getElementById("gal1").value = bought; //copies the user buyer to index.html hidden field , so that the score_quiz()  can retrieve it.
	}
}
an example of an inside (iframe) page is:
Code:
<form name="frm" id="frm" action="../wait.html" method="post" >
<div id="set1" style="position:absolute; left:65px;top:146px;">
<span style="position:absolute; left: -63px; top:-55px;width:104px;">
<input name="check" id="check"  type="checkbox" onClick="photos_bought(this.value);" value="Ireland: picture 1 300dpi" />
300dpi $100<br />
<input name="check" id="check"  type="checkbox" onClick="photos_bought(this.value);" value="Ireland: picture 1 600dpi"/>
600dpi $175 </span>
<span style="position:absolute; left: 307px; top:150px;width:71px;">
<textarea name="order" id="order" cols="50" rows="5"></textarea><br />
<input type="button" onClick="createOrder();openpopup();" value="Send order" /><input type="reset" value="Reset" /> 
</span>
</div>

</form>
Reply With Quote

Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
framespacing="0" problem solved cssiscool Programming and Scripting 4 06-14-2007 08:27 AM
javascript / php / forms problem divx Programming and Scripting 2 05-24-2007 12:13 PM
Empty values r sent to the database! dragon Programming and Scripting 0 10-06-2006 12:33 PM
weird problem with FF 1.5.0.6 flashwood59 Programming and Scripting 0 09-11-2006 02:35 PM
Setting Values For Form Elements With Unconventional Names curtiss Programming and Scripting 2 06-04-2006 09:28 PM


All times are GMT -5. The time now is 01:29 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter