Solved

pre-Sized POP UP Windows from a Form Submit button

Posted on 2002-03-15
8
179 Views
Last Modified: 2013-12-24
I'm looking for a piece of code that will initiate a pre-Sized POP UP Windows from a Form Submit button. I have been able to make a pre-sized window pop up from a regualr link but What I want to do now is have someone choose an option from a dop down menu, click the continue form button and have an application page I made pop up in a window I presized. Anyone have this code or a link to a URL which shows how to do it. I know I can do a target=blank but I want to be able to manage what the pop up window shows (No address line, etc..)

Thanks for your help!





HERES THE FORM CODE:


<cfform METHOD="POST" ACTION="agents_app.cfm?main=#URL.main#">
<SELECT NAME="PLAN">
<OPTION VALUE="PLAN10">PLAN10</OPTION>
<OPTION VALUE="PLAN15">PLAN15</OPTION>
<OPTION VALUE="PLAN20">PLAN20</OPTION>
<OPTION VALUE="PLAN25">PLAN25</OPTION>
</SELECT>
<INPUT TYPE="submit" VALUE="Continue">

0
Comment
Question by:gplemos071400
  • 4
  • 3
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6869263
<script>

function openWindow(frm) {
window.open ('yourpage.cfm', 'newWin', 'scrollbars=yes,status=yes,width=300,height=300')
frm.submit();
}

</script>

<form METHOD="POST" ACTION="agents_app.cfm?main=#URL.main#">
<SELECT NAME="PLAN">
<OPTION VALUE="PLAN10">PLAN10</OPTION>
<OPTION VALUE="PLAN15">PLAN15</OPTION>
<OPTION VALUE="PLAN20">PLAN20</OPTION>
<OPTION VALUE="PLAN25">PLAN25</OPTION>
</SELECT>
<input type="button" value="Continue">
onclick="openWindow(this.form);"
</form>

Now, you can also use OnSubmit event too.

CJ
0
 
LVL 5

Expert Comment

by:Yog
ID: 6870828
<script language="JavaScript">
Clicked=false;
function openWindow() {
    myWindowHandle = window.open('about:blank','myWindow','width=400,height=400');
}
</script>

<form name="myForm" action="agents_app.cfm?main=#URL.main#" target="myWindow" onSubmit="if (!Clicked) return false">
<SELECT NAME="PLAN">
<OPTION VALUE="PLAN10">PLAN10</OPTION>
<OPTION VALUE="PLAN15">PLAN15</OPTION>
<OPTION VALUE="PLAN20">PLAN20</OPTION>
<OPTION VALUE="PLAN25">PLAN25</OPTION>
</SELECT>
<input type="button" onClick="openWindow(); Clicked=true; setTimeout('document.myForm.submit()',500)" value="submit">
</form>

0
 

Author Comment

by:gplemos071400
ID: 6876788
cheekycj, you can see what your piece is doing at:
http://www.lemosnet.com/misc/agents_esaform2.cfm

I'm sure I must have fudged the code some, check out the source and you'll see what its doing. Its opening up a pop up window and also opening up a regular window of the same poge but its not passing the information needed via the POST so the form can work. Take a look and let me know if we can do anything with it?




Yog, I have set up your as well at:
http://www.lemosnet.com/misc/agents_esaform3.cfm

This one is not going to the next page like the above (its staying put like it should) but it is opening up the window, however it too is not passing the POST info from the form to make the form work. The form is looking for that PLAN number to decide what to display on screen.



I actually have a working version of what I need from someone else and you can view the code here:
http://www.lemosnet.com/misc/agents_esaform.cfm



I like the code you two gave me because it was short and sweet vs the link above that IS working, and working is all that matters I guess. Feel free to look at it and see if you guys get some ideas.

I would like to show the STATUS bar so I can see the "SECURE LOCK ICON" on the pop up window.

Man.. one day I really gotta just sit down and learn javascript much more detailed, ROFL...

Thanks for the help so far guys!
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 19

Expert Comment

by:cheekycj
ID: 6876855
try this instead:
<script>
function openWindow(frm) {
window.open ('yourpage.cfm', 'newWin', 'scrollbars=yes,status=yes,width=300,height=300');
frm.target="newWin";
frm.submit();
}

</script>

<form METHOD="POST" ACTION="agents_app.cfm?main=#URL.main#">
<SELECT NAME="PLAN">
<OPTION VALUE="PLAN10">PLAN10</OPTION>
<OPTION VALUE="PLAN15">PLAN15</OPTION>
<OPTION VALUE="PLAN20">PLAN20</OPTION>
<OPTION VALUE="PLAN25">PLAN25</OPTION>
</SELECT>
<input type="button" value="Continue">
onclick="openWindow(this.form);"
</form>
0
 

Author Comment

by:gplemos071400
ID: 6876902
cheekycj, look at the source code on:
http://www.lemosnet.com/misc/agents_esaform2.cfm
Look at the code and see if you think I have manipulated anything incorrectly if you would not mind. I great appreciate it.


When the pop up window comes up, it actually looks like it errors out first, then displays the page. WEIRD! Although it looks like it works, I am not comfortable with that quick display of an error page.
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 100 total points
ID: 6876919
OK.. this should work better:
<script>
function openWindow(frm) {
window.open ('about:blank', 'newWin', 'scrollbars=yes,status=yes,width=300,height=300');
frm.target="newWin";
frm.submit();
}

</script>

<form METHOD="POST" ACTION="agents_app.cfm?main=#URL.main#">
<SELECT NAME="PLAN">
<OPTION VALUE="PLAN10">PLAN10</OPTION>
<OPTION VALUE="PLAN15">PLAN15</OPTION>
<OPTION VALUE="PLAN20">PLAN20</OPTION>
<OPTION VALUE="PLAN25">PLAN25</OPTION>
</SELECT>
<input type="button" value="Continue">
onclick="openWindow(this.form);"
</form>
0
 

Author Comment

by:gplemos071400
ID: 6876936
Right on cheekycj!
That does what I need.
Thanks to all for the help!
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6876951
No Problem.  Glad I could Help.

Thanx for the "A".

Cheers,
CJ
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

840 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