?
Solved

open new window using cflocation

Posted on 2003-03-14
15
Medium Priority
?
934 Views
Last Modified: 2013-12-24
How to open a new window using cflocation.
0
Comment
Question by:sangh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +2
15 Comments
 
LVL 5

Expert Comment

by:JimV_ATL
ID: 8138362
Opening a new window happens on the browser (client side), so you'll need to use JavaScript (Client side) not ColdFusion/Cflocation (Server side).

Check out this page with good sample code to open a window:

http://www.htmlgoodies.com/beyond/openwin.html
0
 

Expert Comment

by:DynAstY
ID: 8138737
Open the window with javascript window.open the seesion will continue as long as the application.cfm is within same structure as the opened cfm page.

Example:

<INPUT TYPE="button" VALUE="Administration" OnClick="JavaScript: window.open('DefaultAdmin.cfm','MyAdminWindow','width=350,height=450,scrollbars=yes,status=yes, resizable=yes, left=150,top=40');">
0
 

Author Comment

by:sangh
ID: 8138910
I do cflocation from 1.cfm which goes to 2.cfm and 2.cfm opens 3.cfm using cflocation.

2.cfm which calls 3.cfm is not visible to user. So user cannot click on any button.

My question is how can open 3.cfm in a new window instead of opening in the same window.

Thanks.


0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 5

Expert Comment

by:JimV_ATL
ID: 8138956
In 2.cfm, instead of cflocation put.

<SCRIPT LANGUAGE="javascript">
<!--
window.open ('3.cfm')
-->
</SCRIPT>
0
 

Expert Comment

by:DynAstY
ID: 8138970
lol
0
 

Author Comment

by:sangh
ID: 8139310
How do I pass variables without using cflocation.
 my code looks like this now.
<cflocation="http://usr/local/test.cfm?one=#one#">
0
 

Accepted Solution

by:
DynAstY earned 100 total points
ID: 8139348
<SCRIPT LANGUAGE="javascript">
<!--
window.open ('test.cfm?one=<CFOUTPUT>#one#</CFOUTPUT>'>);
-->
</SCRIPT>
0
 
LVL 11

Expert Comment

by:hart
ID: 8141491
u could also submit 2.cfm to a pop up window using target.

that is in 2.cfm say u have a form
<SCRIPT LANGUAGE="javascript">
<!--
window.open ('3.cfm','window3','width,height etc..');
document.frm.submit();
-->
</SCRIPT>

<form name="frm" action="3.cfm" target="wndow3" onsubmit="callme()">
<input type="hidden" name="one" value="#one#">
<input type="submit" name="sub" value="Click Me">
</form>


Regards
Harish(Hart)
0
 

Author Comment

by:sangh
ID: 8152252
My code looks like this. When I click on submit "frm_submitted" is true and it is opening d.cfm in a new page. The problem is whenever I referesh c.cfm without clicking on submit it submits the page and multiple rows gets intserted to a table. How to solve this. Thanks.

<cfparam name="frm_submitted" default="false">
<form name="frm" method="post" action="c.cfm">
        <input type="submit" name="submit" value="submit">
       <input type="hidden" name="frm_submitted" value="true">

<cfif frm_submitted is "true">  
<cfquery="testqry">
insert into---
</cfquery>

<SCRIPT LANGUAGE="javascript">
 <CFOUTPUT>
window.open ('http://test/test1/d.cfm');
</CFOUTPUT>
</SCRIPT>
</cfif>
</form>
0
 
LVL 5

Expert Comment

by:JimV_ATL
ID: 8152832
This should work.  The cflocation should reset the state of the page.

<cfparam name="frm_submitted" default="false">
<CFOUTPUT>
<form name="frm" method="post" action="c.cfm">
<input type="submit" name="submit" value="submit">
<input type="hidden" name="frm_submitted" value="true">
</form>

<cfif frm_submitted is "true">  
     <cfquery="testqry">
     insert into---
     </cfquery>

     <SCRIPT LANGUAGE="javascript">
     window.open('http://test/test1/d.cfm');
     </SCRIPT>
     
     <cflocation url="c.cfm" addtoken="No">

</cfif>
0
 
LVL 5

Expert Comment

by:JimV_ATL
ID: 8152841
I forgot a close cfoutput!

<cfparam name="frm_submitted" default="false">
<CFOUTPUT>
<form name="frm" method="post" action="c.cfm">
<input type="submit" name="submit" value="submit">
<input type="hidden" name="frm_submitted" value="true">
</form>

<cfif frm_submitted is "true">  
     <cfquery="testqry">
     insert into---
     </cfquery>

     <SCRIPT LANGUAGE="javascript">
     window.open('http://test/test1/d.cfm');
     </SCRIPT>
     
     <cflocation url="c.cfm" addtoken="No">

</cfif>
</CFOUTPUT>
0
 

Author Comment

by:sangh
ID: 8153070
If I use  <cflocation url="c.cfm" addtoken="No"> java script is not working (not opening d.cfm in a new window).
Is there a way when c.cfm page is refreshed make frm_submitted to "false" and don't open d.cfm.
when clicked on the submit button in c.cfm make frm_submitted value to "true" and open d.cfm in a new window.
0
 
LVL 11

Expert Comment

by:hart
ID: 8192910
send me your three pages code and i will rewrite it and send it to u.

send it to me at harish@direct2s.com

regards
Hart(Harish)
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10940627
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation in the Cleanup topic area:

Accept DynAstY

Please leave any comments here within the next four days.

mrichmon
EE Cleanup Volunteer
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question