PDA

View Full Version : Send a variable/s from Popup2 to Popup1



cclambie
12-11-2007, 01:21 PM
1) Script Title:
DHTML Window Widget
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm
3) Describe problem:

I want to post variables from Popup2 to Popup1?

I am using a function on the Parent, but it isn't working?

I am using 2 pop ups to ensure that popup2 doesn't appear inside the small popup1 window.

:
Parent Script
------------------------------------------
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
var transwin
var ratewin


function OpenTranWin() {
//alert (BankCode);
transwin = dhtmlwindow.open('New Transaction', 'iframe', '../Trans/TransAddNew.asp', 'Enter New Transaction', 'width=500px,height=600px,center=1');

}
function closetranswin_onchange() {
//alert("test");
transwin.close();

}

function OpenRateWin(BankCode) {
//alert (BankCode);
ratewin = dhtmlwindow.open('Select Rate', 'iframe', '../Trans/AddBanksRatesMain_nh.asp?BankCode=' + BankCode, 'Select Rate', 'width=850px,height=400px,center=1');

}

function closeRateWin_onchange() {
//alert("test");
ratewin.close();

}

function updaterates_selected(varRateId, varRate, varBank) {
//Update Child Iframe Frm with Rate Info
transwin.document.frmNewTrans.txtRateID.value = varRateId;
//transwin.frmNewTrans.txtRate.value = varRate;
//transwin.frmNewTrans.txtBank.value = varBank;
//Close Rate Window
closeRateWin_onchange();
}

//-->
</SCRIPT>

-------------------------
rateWin Script
-------------------------
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function updaterateparent(varRateID, txtRate, varBank) {

if (typeof(parent.rate_onclick)=='function') parent.rate_onclick(varRateID, txtRate, varBank);
}

//-->
</SCRIPT>
----------------------------------
HTML Source of Transwin
----------------------------------
<form name='frmNewTrans' id='frmNewTrans' method='post' action='../../Forms/frmNewTrans.asp'>
<table><th>New Deal Form</th><th></th>
<tr></tr><tr></tr>
<th></th><th>Value</th>
<tr><th>Group/ Base</th><td><iframe name=iframe_SelectGroupBase id=iframe_SelectGroupBase scrolling=0 frameborder=0 src=SelectGroupBase.asp?GroupID= width=350 height=180></iframe></td>
</tr><tr>
<th>Type</th>
<td><Select type=text id=txtType name=txtType><Option Value=2 >Debit</Option>
<Option Value=3 >Credit</Option>
<Option Value=4 >Transfer to WC</Option>
<Option Value=5 >Transfer to IC</Option>
</Select></td></tr>
<tr><th>Transaction Date</th><td><INPUT disabled type=text id=txtTranDate name=txtTranDate value=11/12/2007 size=15></td></tr>
<tr><th>Value Date</th><td><INPUT type=text id=txtValueDate name=txtValueDate value=11/12/2007 size=15></td></tr>
<tr><th>Maturity Date</th><td><INPUT type=text id=txtMaturityDate name=txtMaturityDate value=12/12/2007 size=15></td></tr>
<tr><th><a class="notvisit" href="javascript:parent.OpenRateWin()">Rate</a></th><td><INPUT disabled type=text id=txtRate name=txtRate size=15 onclick="javascript:OpenRateWin();"><INPUT type=hidden id=txtRateID name=txtRateID></td></tr>
<tr><th ><a class="notvisit" href="javascript:parent.OpenRateWin()" class="notvisit">Bank</a></th><td><INPUT disabled type=text id=txtBank name=txtBank size=15></td>
<tr><th>Dealer</th><td><INPUT disabled type=text id=txtDealer name=txtDealer size=15 value=LAMBIEC></td></tr>
<tr><th>Details</th><td><Select type=text id=txtDetails name=txtDetails><Option Value=6 >New Depo</Option>
<Option Value=7 >Depo Increase</Option>
<Option Value=8 >Depo Decrease</Option>
<Option Value=9 >Depo Repay</Option>
<Option Value=10 >Rollover</Option>
</Select></td></tr>
<tr><th>Amount</th><td><INPUT type=text id=monAmount name=monAmount size=15></td></tr>
</table>
<img Name='Add' id='Add' onmouseover=javascript:ImageOver('Add') onmouseout=javascript:ImageOff('Add') src=../../images/Add.gif onclick=vbscript:sbValidateForm() ></form>