Solved

pre-Sized POP UP Windows from a Form Submit button

Posted on 2002-03-15
8
180 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
Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

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…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

733 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