Solved

pre-Sized POP UP Windows from a Form Submit button

Posted on 2002-03-15
8
171 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
Comment Utility
<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
Comment Utility
<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
Comment Utility
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
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:gplemos071400
Comment Utility
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
Comment Utility
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
Comment Utility
Right on cheekycj!
That does what I need.
Thanks to all for the help!
0
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
No Problem.  Glad I could Help.

Thanx for the "A".

Cheers,
CJ
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now