473,548 Members | 2,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pass query string using popup

Hello All....

What I am attempting to do is have a link/button on a page
(testpopup.cfm) that opens a popup page (popupwindow.cf m). The popup
page displays a resultset from a query and the selected record needs
to be passed through a query string/URL parameter to the original
calling page and will be available in the body onload event of the
calling page.

I open the popup window and display the query results, I then click on
a record and the record is then displayed in the calling form textbox
(txtOrg) - - - only the calling form appears in the POPUP window!
This is not what I need it to do. I need it to pass the URL parameter
to the calling page and close the popup. Here is the code from the
two pages. Can you shed any light on this?
testpopup.cfm

<html>
<head>

<script language="JavaS cript">
var strValue = location.search .split( '=' )[1];
</script>
</head>

<body onLoad="documen t.MyForm.txtOrg .value = strValue;">

<form action="" method="get" name="MyForm" id="MyForm">
<input name="txtOrg" type="text" id="txtOrg">
<input type="button" name="choice"
onClick="window .open('popupwin dow.cfm','','wi dth=300,height= 300,top=100,lef t=100');"
value="Search for Org"><br>
</form>

</body>
</html>

popupwindow.cfm

<html>
<head>

<cfquery name="OrgDetail " datasource="InT ouch">
select * from vwOrgDetail
</cfquery>

<title>Select Organization</title>
</head>
<body>

<cfoutput query="OrgDetai l">
<a href="testpopup .cfm?Name=#Name #"
onclick="javasc ript:self.close ()">#Name#</a><br>
</cfoutput>

</body>
</html>
Jul 23 '05 #1
1 12969
In article <f0************ **************@ posting.google. com>,
ta*******@new.r r.com enlightened us with...

I open the popup window and display the query results, I then click on
a record and the record is then displayed in the calling form textbox
(txtOrg) - - - only the calling form appears in the POPUP window!
This is not what I need it to do. I need it to pass the URL parameter
to the calling page and close the popup. Here is the code from the
two pages. Can you shed any light on this?
Yeah, you're targeting the same window. Why would it open in the other one?
;)

<cfoutput query="OrgDetai l">
<a href="testpopup .cfm?Name=#Name #"
onclick="javasc ript:self.close ()">#Name#</a><br>


Right there. No target. Hence, target is self.

<a href="testpopup .cfm?Name=#name #" target="window. opener"
onClick="self.c lose()">

Ditch the "javascript " from event handler onClick: it's redundant. All
handlers are javascript unless specified otherwise (vbscript for IE).

Also, you may have a problem doing the self.close in the onClick, since I'm
not sure that it won't close the window BEFORE the anchor is followed (thus,
the main page would do nothing).

This might work a lot better:
(note quotes changed to avoid nesting issues)

<a href="#" onClick='doIt(" #Name#"); return false;'>link</a>

function doIt(name)
{
window.opener.h ref="testpopup. cfm?Name="+name ;
self.close();
}

Give it a shot.
HTH
--
--
~kaeli~
A midget fortune teller who escapes from prison is a small
medium at large.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
23644
by: Matt | last post by:
In ASP, when we pass data between pages, we usually pass by query string. If we pass data by query string, that means we need to use submit button, not by regular button, and the form will pass to the server since it's GET or POST request. But if just form-to-form communication, why we need to send the form to the server? Please help clarify....
4
14221
by: Corey | last post by:
All, I am relatively new to XML and I have what may sound like a dumb question. I want to pass a query string variable to my xml document and filter the output based on that variable. For example, if I type in www.mysite.com?geid=0000123468 I want to display only AccessReview/Report where GEID='0000123468'. I appreciate any help you can...
4
4803
by: news-server.tampabay.rr.com | last post by:
Hi, Below is a stock script I found which controls a framed environment. My problem is that if a URL has a query string attached, that string does not pass through. Can someone please let me know if and hopefully how, it will be possible to carry a query string through? This first part here is in the default.asp framed page. <SCRIPT...
4
3461
by: Loopsludge | last post by:
ASP.NET 2.0/ SQL Server 2005/ Login Controls Does anyone know how to format a SQL query string using asp:loginname in the WHERE clause? Alternatively would I need to store the login name upon login w/in a Session variable? Can someone give me an example?
6
4381
by: Ellie | last post by:
In my program the user clicks on a link and using the window.open function, opens a new window. I pass a url to the new window like this: <a href="#" onClick="window.open('../quotescreenwindow.php?enroll_id=enrollwindowprime.php', 'WindowC', 'width=750,height=800,scrollbars=yes');"> In the new window that just opened called...
12
2151
by: Kevin Blount | last post by:
I'm having a very odd issue, that arose this morning after working fine yesterday... here's a very simple script: 1: <?php 2: $test = $_GET; 3: echo "Hello" . $test . "<p>"; 4: ?>
2
5625
by: I Hate My Computer | last post by:
I am using frames on a website. The title link on the title page adds a query string. The link goes to a page with two rows the second has two columns. I want the right column to be changed depending on what the query string is. I have the script to parse the query string here: function getQueryVariable(variable) { var query =...
0
7438
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
751
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.