Click to See Complete Forum and Search --> : passing variables between pages


muwa
05-27-2003, 11:08 AM
I have a pop page with a known variable on it. I want that variable to be passed to a page with a form in it. I want the variable to appear in the form field, but I don't want the form to submit right away.

Anyone know of a script/tutorial that will show me how to do this?

Thank you very much,
Mischa

khalidali63
05-27-2003, 11:10 AM
Take alook at this link,it covers all aspects of parent child communication
http://68.145.35.86/skills/javascripts/ParentWinInteractionWithChildWin.html

requestcode
05-27-2003, 11:16 AM
Here is another tutorial on the subject:
http://www.javascriptkit.com/javatutors/send1.shtml

muwa
05-27-2003, 03:29 PM
I used Mr. Khalid's example and created the following. I had to hardcode the name of the form in variable disFld_String. I had both variables submitting back to the same form, but with different values.

<script type="text/javascript">
<!--
function sendData(obj){
var frmName = (obj.id).toString();
var fldName = obj[0].name;
var currentForm = document.getElementById(frmName);
var disFld_String =eval('top.opener.document.advSearchResultsForm.'+fldName);
var value = (eval('currentForm.'+fldName)).value;
disFld_String.value = value;
return false;
}
//-->
</script>

<form id="someid" action="" onSubmit="return sendData(this);">
<input type="text" name="NAICS_Code_txt_t" value="<cfoutput>#ncode#</cfoutput>">
<input type="submit" value="submit">
</form>

<form id="someid1" action="" onSubmit="return sendData(this);">
<input type="text" name="NAICS_Code_txt_f" value="<cfoutput>#ncode#</cfoutput>">
<input type="submit" value="submit">
</form>

I mixed a little CF in there, so that is what the pound (#) signs are for :) Thank you both very much for your help. It was much appreciated! :)

Mischa

khalidali63
05-27-2003, 03:38 PM
:D Pleasure is all mine..
We love to help here....