473,581 Members | 2,757 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Posting form into a new window

Eli
How can I POST a form into a new window where I control the size and
other attributes of the new window?

Also. Are there any implications, perhaps due to browser security
(Interne Explorer?) that could cause problems if I try to post a form
at www.mydomain.com to www.anotherdomain.com?

Jul 23 '05 #1
32 2472

Eli wrote:
How can I POST a form into a new window where I control the size and
other attributes of the new window?

Also. Are there any implications, perhaps due to browser security
(Interne Explorer?) that could cause problems if I try to post a form
at www.mydomain.com to www.anotherdomain.com?


not sure what you mean, but I've done forms in pop-ups a lot.. go here
and click at the bottom where it says "form":

http://www.francesdelrio.com/hbl/

Jul 23 '05 #2
Eli
On Sat, 25 Sep 2004 18:30:21 -0400, Frances Del Rio <fd***@yahoo.co m>
wrote:
Eli wrote:
How can I POST a form into a new window where I control the size and
other attributes of the new window?

Also. Are there any implications, perhaps due to browser security
(Interne Explorer?) that could cause problems if I try to post a form
at www.mydomain.com to www.anotherdomain.com?


not sure what you mean, but I've done forms in pop-ups a lot.. go here
and click at the bottom where it says "form":

http://www.francesdelrio.com/hbl/

No, that's not what I meant.

I wish to post from a form that appears on a web page (it's a visitor
poll) to an action= page that will appear in a newly opened window.
Using only target= in the <form> tag doesn't give you the ability to
control the window's size and attributes.

Jul 23 '05 #3
Frances Del Rio wrote:

Eli wrote:
How can I POST a form into a new window where I control the size and
other attributes of the new window?
You don't. It's *my* browser, stop trying to change it's size.
Also. Are there any implications, perhaps due to browser security
(Interne Explorer?) that could cause problems if I try to post a form
at www.mydomain.com to www.anotherdomain.com?

Ummm, why not test it? Hmmm.

not sure what you mean, but I've done forms in pop-ups a lot.. go here
and click at the bottom where it says "form":

http://www.francesdelrio.com/hbl/


What I get from that URL, when clicking "form", is navigated to
http://www.francesdelrio.com/hbl/#

so, before you quote a page as a reference, maybe you should validate
the page and test it in something besides IE.

But looking at the source of that page, you should ditch it, start over,
and end up (maybe) with something decent enough to use as an example?

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #4
fox
Eli wrote:
On Sat, 25 Sep 2004 18:30:21 -0400, Frances Del Rio <fd***@yahoo.co m>
wrote:

Eli wrote:

How can I POST a form into a new window where I control the size and
other attributes of the new window?

Also. Are there any implications, perhaps due to browser security
(Interne Explorer?) that could cause problems if I try to post a form
at www.mydomain.com to www.anotherdomain.com?


not sure what you mean, but I've done forms in pop-ups a lot.. go here
and click at the bottom where it says "form":

http://www.francesdelrio.com/hbl/


No, that's not what I meant.

I wish to post from a form that appears on a web page (it's a visitor
poll) to an action= page that will appear in a newly opened window.
Using only target= in the <form> tag doesn't give you the ability to
control the window's size and attributes.


Just create a "named" window with window open and submit the form to it
by setting the target to the newly created window name [there actually
*IS* a purpose for the second argument to window.open!]:

<form onsubmit = "return handleSubmit(th is)">
.....

// the JS:

function
handleSubmit(f)
{
// f => form reference

// you can set these attributes in the form tag if you want
f.action = "script2call.ex t";
f.method = "POST or GET"; // one OR the other
f.target = "myFormWind ow";

// create your named window:
var w = window.open("", "myFormWindow", "AttributesList ");

f.submit();
return false; // or navigate to another page...
}
I tested this in Mozilla with "Block unrequested popup windows" checked
-- and it still worked, but if the user has JS turned off, then this is
toast.. so:

<noscript>
<h3>This site requires JavaScript...</h3>

</noscript>

Jul 23 '05 #5
fox wrote:

<--snip-->
I tested this in Mozilla with "Block unrequested popup windows" checked
-- and it still worked, but if the user has JS turned off, then this is
toast.. so:


Why not just have a normal form, with an action attribute set, and let
it remain in the main window? The noscript element is not the best
place to explain that "I am too incompetent to make my site non-JS
dependent so you must use a browser that supports it and has it enabled"

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #6
Eli
On Sat, 25 Sep 2004 18:58:46 -0500, fox <fo*@fxmahoney. com> wrote:
Eli wrote:
On Sat, 25 Sep 2004 18:30:21 -0400, Frances Del Rio <fd***@yahoo.co m>
wrote:

Eli wrote:
How can I POST a form into a new window where I control the size and
other attributes of the new window?

Also. Are there any implications, perhaps due to browser security
(Interne Explorer?) that could cause problems if I try to post a form
at www.mydomain.com to www.anotherdomain.com?

not sure what you mean, but I've done forms in pop-ups a lot.. go here
and click at the bottom where it says "form":

http://www.francesdelrio.com/hbl/


No, that's not what I meant.

I wish to post from a form that appears on a web page (it's a visitor
poll) to an action= page that will appear in a newly opened window.
Using only target= in the <form> tag doesn't give you the ability to
control the window's size and attributes.


Just create a "named" window with window open and submit the form to it
by setting the target to the newly created window name [there actually
*IS* a purpose for the second argument to window.open!]:

<form onsubmit = "return handleSubmit(th is)">
....

// the JS:

function
handleSubmit(f )
{
// f => form reference

// you can set these attributes in the form tag if you want
f.action = "script2call.ex t";
f.method = "POST or GET"; // one OR the other
f.target = "myFormWind ow";

// create your named window:
var w = window.open("", "myFormWindow", "AttributesList ");

f.submit();
return false; // or navigate to another page...
}
I tested this in Mozilla with "Block unrequested popup windows" checked
-- and it still worked, but if the user has JS turned off, then this is
toast.. so:

<noscript>
<h3>This site requires JavaScript...</h3>

</noscript>


Hey, thanks a lot!

I found some code elsewhere that was very similar to what you've
posted, with the action, method and target set in the form tag (as you
note is possible). A couple of questions:

- Instead of "f.submit() " and "return false", would the single
statement "return true" accomplish the same thing, or is there a
difference?

- What is the difference between open() and window.open()? The other
code used open(), which I'd never used before.

Jul 23 '05 #7
Eli
On Sat, 25 Sep 2004 20:40:06 -0400, Randy Webb
Why not just have a normal form, with an action attribute set, and let
it remain in the main window? The noscript element is not the best
place to explain that "I am too incompetent to make my site non-JS
dependent so you must use a browser that supports it and has it enabled"


Why not go do something useful for somebody?

Jul 23 '05 #8

Randy Webb wrote:
Frances Del Rio wrote:

Eli wrote:
How can I POST a form into a new window where I control the size and
other attributes of the new window?

You don't. It's *my* browser, stop trying to change it's size.
Also. Are there any implications, perhaps due to browser security
(Interne Explorer?) that could cause problems if I try to post a form
at www.mydomain.com to www.anotherdomain.com?

Ummm, why not test it? Hmmm.

not sure what you mean, but I've done forms in pop-ups a lot.. go here
and click at the bottom where it says "form":

http://www.francesdelrio.com/hbl/

What I get from that URL, when clicking "form", is navigated to
http://www.francesdelrio.com/hbl/#

so, before you quote a page as a reference, maybe you should validate
the page and test it in something besides IE.

But looking at the source of that page, you should ditch it, start over,
and end up (maybe) with something decent enough to use as an example?


gees, thanks... I guess some of us are more tolerant of mistakes than
others.. ;) it's working on netscape now.. in both English and Spanish..
(I test everything on IE and netscape.. this was an inadvertent
mistake... and whaddayaknow... it even works in that very quirky
broswer called 'Opera'...)
would have been nice if you had said what browser it's not working on
for you..

http://www.francesdelrio.com/hbl/index.html

Jul 23 '05 #9
Frances Del Rio wrote:

Randy Webb wrote:
Frances Del Rio wrote:

Eli wrote:

How can I POST a form into a new window where I control the size and
other attributes of the new window?


You don't. It's *my* browser, stop trying to change it's size.
Also. Are there any implications, perhaps due to browser security
(Interne Explorer?) that could cause problems if I try to post a form
at www.mydomain.com to www.anotherdomain.com?


Ummm, why not test it? Hmmm.

not sure what you mean, but I've done forms in pop-ups a lot.. go
here and click at the bottom where it says "form":

http://www.francesdelrio.com/hbl/


What I get from that URL, when clicking "form", is navigated to
http://www.francesdelrio.com/hbl/#

so, before you quote a page as a reference, maybe you should validate
the page and test it in something besides IE.

But looking at the source of that page, you should ditch it, start
over, and end up (maybe) with something decent enough to use as an
example?

gees, thanks... I guess some of us are more tolerant of mistakes than
others.. ;) it's working on netscape now.. in both English and Spanish..
(I test everything on IE and netscape.. this was an inadvertent
mistake... and whaddayaknow... it even works in that very quirky
broswer called 'Opera'...)
would have been nice if you had said what browser it's not working on
for you..

http://www.francesdelrio.com/hbl/index.html


Of course, you are right. But it didn't work in Mozilla, and nicely, it
works now.

Still not sure why you use all the un-needed evals though.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
7262
by: Daniel | last post by:
Ah, new question =) (Well, half-new, I asked something similar a while ago, but disregarded the question myself) Is there any way to post data to Javascript in a new page without using a form or, alternatively, to dynamically construct a "virtual" form object (such as new Form();) and submit it? Thanks in advance, Daniel
1
1456
by: Linda | last post by:
I've created a simple form for a conf registration, that successfully validates the form. But then in testing, when you try to submit, Outlook Express comes up automatically, instead of my own email. And the content of the form doesn't appear in the body of that Outlook Express email, either. How do I make it use the correct email? I'm a...
2
1370
by: Astra | last post by:
Hi All I know I may sound like an IE waif, but I am trying to get my web sites to be more compatible especially with browsers such as Netscape, Safari, Mozilla, etc. In a nutshell, could somebody please post me an example of how I can force a form submit to post form data to a new/separate window rather than the original window it is in....
6
8813
by: Eli | last post by:
How can I POST a form into a new window where I control the size and other attributes of the new window? Also. Are there any implications, perhaps due to browser security (Interne Explorer?) that could cause problems if I try to post a form at www.mydomain.com to www.anotherdomain.com?
2
1634
by: mike | last post by:
I have a page with a form as follows: <form name="updfrm" method="post" action="update_db.cfm"> <input type="text" name="myfield" value="stuff"> <button onclick="sub_this();">press here</button> </form> normally I would either 1) let this form post to this window, or 2) open a window and post to it.
7
1497
by: Jeff Casbeer | last post by:
New to VB.. What is the VB syntax for posting a Windows event? For example, to have an event fire AFTER a form loads, I'd add a posted call to a "post_load" event, from "load". What is the VB syntax for that deferred call? Raiseevent seems to be synchronous, as does just calling the handler subroutine. Also, how do I defer processing to...
0
1796
by: homsar | last post by:
I've seen many posts discussing the options we have when using modal windows within a web based application. Often times it seems the greatest hurdle is simply getting the modal window to post back to itself. It appears that most of these threads where this was discussed have been archived, so I'm bringing this topic up again to offer a couple...
3
4699
by: simora | last post by:
Hi: Need some working sample code to post hidden form data from a php page to a new popup window. 540 x 500 centered. The popup that I'm calling already is formatted and has a TITLE:web-2007.php so what I need to do is to write the values from the PHP page to that popup in specific places. Some of the hidden values are also like this...
1
7267
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category and Brand I need to make some changes on a a number of brands in a Category
0
7876
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7804
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6563
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1144
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.