473,325 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

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.cfm). 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="JavaScript">
var strValue = location.search.split( '=' )[1];
</script>
</head>

<body onLoad="document.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('popupwindow.cfm','','width=3 00,height=300,top=100,left=100');"
value="Search for Org"><br>
</form>

</body>
</html>

popupwindow.cfm

<html>
<head>

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

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

<cfoutput query="OrgDetail">
<a href="testpopup.cfm?Name=#Name#"
onclick="javascript:self.close()">#Name#</a><br>
</cfoutput>

</body>
</html>
Jul 23 '05 #1
1 12929
In article <f0**************************@posting.google.com >,
ta*******@new.rr.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="OrgDetail">
<a href="testpopup.cfm?Name=#Name#"
onclick="javascript:self.close()">#Name#</a><br>


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

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

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.href="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
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...
4
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...
4
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...
4
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...
6
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="#"...
12
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.