?
Solved

pre-Sized POP UP Windows from a Form Submit button

Posted on 2002-03-15
8
Medium Priority
?
182 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
[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
  • 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
Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

 
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 400 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

Limited time offer using promo code EXPERTS25

Designed with a wealth of functionality and convenience, ATEN's new Thunderbolt™ 2 Sharing Switch takes your Thunderbolt setup to the next level. Now through August 31, 2017, Experts Exchange members get 25% off the US7220 on the ATEN USA eShop using promo code EXPERTS25.

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 …
What You Need to Know when Searching for a Webhost Provider
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 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