By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,813 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,813 IT Pros & Developers. It's quick & easy.

Posting form into a new window

P: n/a
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
Share this Question
Share on Google+
32 Replies


P: n/a

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

P: n/a
Eli
On Sat, 25 Sep 2004 18:30:21 -0400, Frances Del Rio <fd***@yahoo.com>
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

P: n/a
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.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #4

P: n/a
fox
Eli wrote:
On Sat, 25 Sep 2004 18:30:21 -0400, Frances Del Rio <fd***@yahoo.com>
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(this)">
.....

// the JS:

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

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

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

P: n/a
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.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #6

P: n/a
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.com>
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(this)">
....

// the JS:

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

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

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

P: n/a
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

P: n/a

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

P: n/a
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.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #10

P: n/a
Eli wrote:
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?


Since you seem to have missed the point, its not worth the bother.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #11

P: n/a


Randy Webb wrote:
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.


you know, this is sthg I learned in a book a few years ago (don't
remember if it was the JS Bible or a DHTML book I used a few years ago
called "DHTML for the World Wide Web: Visual Quickstart Guide" by Jason
C. Teague, from that little book I learned to do the DHTML on this pg..
http://www.francesdelrio.com/dhtml/sonnets.html

and it has become kind of a bad habit.. a number of people here have
told me not to do that.. so: when is it ok to use evals?? thank you..
Frances



Jul 23 '05 #12

P: n/a
Frances Del Rio wrote:


Randy Webb wrote:


<--snip-->
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.

you know, this is sthg I learned in a book a few years ago (don't
remember if it was the JS Bible or a DHTML book I used a few years ago
called "DHTML for the World Wide Web: Visual Quickstart Guide" by Jason
C. Teague, from that little book I learned to do the DHTML on this pg..
http://www.francesdelrio.com/dhtml/sonnets.html

and it has become kind of a bad habit.. a number of people here have
told me not to do that.. so: when is it ok to use evals?? thank you..
Frances


I only know of two occasions to use it:

1) When executing unknown code. Example: A textarea where you paste in
code, and you eval it to get its resulting action. Its covered in the FAQ.

2) The second is a case I ran into myself, where I was trying to find
the most efficient way to convert a fraction to a decimal and it turned
out that eval was marginally faster. This one is not explicitly covered,
but it falls in the same category.

http://jibbering.com/faq/#FAQ4_40

Covers eval, and alludes to 3_39 which covers obtaining a reference to
an object. That was most of the eval uses I saw in your page. All of
which are now changed :-)
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #13

P: n/a
Fox
Eli wrote:
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.com>
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(this)">
....

// the JS:

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

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

// 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?


Actually, if you want, you can delete both lines -- onsubmit handlers
return true by default.

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


window.open() is more correct...

open() will attempt to call that method on the "current object". I
suspect IE is much more lenient about this syntactical mistake. After
all, IE is a very "do what I *want* and not as I write" kind of
environment. There is also a document.open() as well that is very
different (it "opens" a document for writing with document.write() - it
does not open a new window.) Some browsers, or scripting environments
might complain if you are not more specific.
Jul 23 '05 #14

P: n/a
FOX -- FOX??? is this the FOX that helped me a few years ago when I was
learning JavaScript (am still learning, of course, as you can see if you
come across my posts from the last few days.. am learning Java now, it's
hard, but I still enjoy it...) I remember you were a Netscape specialist
(old netscape, as in layers... ) I remember a really cool page you did
with little colored squares that jumped all over the page... I love
your current site, have been dissecting yr code...

scrollbar-base-color: #98a8b8;
filter: alpha (opacity=80);

CSS never ceases to amaze me.. I can only wonder what other stuff it has
up its sleeve that I don't know of.. I mean those semi-transparent
scrollbars take the cake!!

Frances
Fox wrote:
Eli wrote:
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.com>
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(this)">
....

// the JS:

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

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

// 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?

Actually, if you want, you can delete both lines -- onsubmit handlers
return true by default.

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

window.open() is more correct...

open() will attempt to call that method on the "current object". I
suspect IE is much more lenient about this syntactical mistake. After
all, IE is a very "do what I *want* and not as I write" kind of
environment. There is also a document.open() as well that is very
different (it "opens" a document for writing with document.write() - it
does not open a new window.) Some browsers, or scripting environments
might complain if you are not more specific.


Jul 23 '05 #15

P: n/a
Fox, look what I did with your divs for netscape:

http://www.francesdelrio.com/fox/

heh heh... this is too cool.. I love your that image, it's beautiful...

Frances
Fox wrote:
Eli wrote:
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.com>
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(this)">
....

// the JS:

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

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

// 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?

Actually, if you want, you can delete both lines -- onsubmit handlers
return true by default.

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

window.open() is more correct...

open() will attempt to call that method on the "current object". I
suspect IE is much more lenient about this syntactical mistake. After
all, IE is a very "do what I *want* and not as I write" kind of
environment. There is also a document.open() as well that is very
different (it "opens" a document for writing with document.write() - it
does not open a new window.) Some browsers, or scripting environments
might complain if you are not more specific.


Jul 23 '05 #16

P: n/a
Frances Del Rio wrote:
FOX -- FOX??? is this the FOX that helped me a few years ago when I was
learning JavaScript (am still learning, of course, as you can see if you
come across my posts from the last few days.. am learning Java now, it's
hard, but I still enjoy it...) I remember you were a Netscape specialist
(old netscape, as in layers... ) I remember a really cool page you did
with little colored squares that jumped all over the page... I love
your current site, have been dissecting yr code...

scrollbar-base-color: #98a8b8;
filter: alpha (opacity=80);

CSS never ceases to amaze me.. I can only wonder what other stuff it has
up its sleeve that I don't know of.. I mean those semi-transparent
scrollbars take the cake!!


I guess if you use, and test, with IE, they could be cool, especially
since those two CSS properties are IE-only.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #17

P: n/a
Fox
Frances Del Rio wrote:
FOX -- FOX??? is this the FOX that helped me a few years ago when I was
learning JavaScript
Yes, Frances, I remember, too!
(am still learning, of course, as you can see if you
come across my posts from the last few days.. am learning Java now, it's
hard, but I still enjoy it...) I remember you were a Netscape specialist
(old netscape, as in layers... ) I remember a really cool page you did
with little colored squares that jumped all over the page... I love
your current site, have been dissecting yr code...

scrollbar-base-color: #98a8b8;
filter: alpha (opacity=80);

CSS never ceases to amaze me.. I can only wonder what other stuff it has
up its sleeve that I don't know of.. I mean those semi-transparent
scrollbars take the cake!!

Frances
Fox wrote:
Eli wrote:
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.com>
> 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(this)">
....

// the JS:

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

// you can set these attributes in the form tag if you want
f.action = "script2call.ext";
f.method = "POST or GET"; // one OR the other
f.target = "myFormWindow";
// 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?


Actually, if you want, you can delete both lines -- onsubmit handlers
return true by default.

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


window.open() is more correct...

open() will attempt to call that method on the "current object". I
suspect IE is much more lenient about this syntactical mistake. After
all, IE is a very "do what I *want* and not as I write" kind of
environment. There is also a document.open() as well that is very
different (it "opens" a document for writing with document.write() -
it does not open a new window.) Some browsers, or scripting
environments might complain if you are not more specific.


Jul 23 '05 #18

P: n/a
Fox
Frances Del Rio wrote:
Fox, look what I did with your divs for netscape:

http://www.francesdelrio.com/fox/

heh heh... this is too cool.. I love your that image, it's beautiful...


Thank you! But that site is old and showing its age (I haven't updated
it in a few years...) I left the transparencies out for Mozilla browsers
back then because of severe performance degradation.

Check out http://site-creations.com instead... It still "plays" better
in IE, but Mozilla is coming along (finally). Also, for a really nice
bit of dhtml, check out the HSL Color Schemer under the tools menu
(there's a link for the instructions under the color picker - one new
feature not explained in the instructions - you are able to type an HTML
RGB color in the Main color text box, and hit Enter to set a new color.)

Fox
************
<snipped>
Jul 23 '05 #19

P: n/a
Fox wrote:
Eli wrote: <snip>
- What is the difference between open() and window.open()?
The other code used open(), which I'd never used before.


window.open() is more correct...


There is no measure of relative "correctness" between the two. They are
both valid javascript syntax (examples of the CallExpression
production).
open() will attempt to call that method on the "current
object".
If any object is to be considered the "current object" it would be the
object referred to bye the - this - keyword. The resolution of an
unqualified identifier is against the scope chain and the object
referred to by - this - will not necessarily be on the scope chain
(although the global object is always on the end of the scope chain and
is also most often also the object referred to by - this -).

Given the code:-

open();

- the objects in the scope chain are examined in turn to see if they (or
one of their prototypes, if any) have a property called "open". If one
of them does then a value of the internal Reference type is returned
with the object in question assigned as its "base" object and "open"
assigned to its property name. Then the internal GetValue fucntion is
called with that Reference type as its argument and if the returned
value is an Object that implements the [[Call]] method (so a function)
then it is executed.

Because the global object is always at the end of the scope chain and
the global object is the window object, if not other object on the chain
has an "open" property then the function called is the "open" method of
the window object.

When the code:-

window.open();

- is used the initial identifier resolution against the scope chain is
for "window". in web browser the global object has a property called
"window", that is itself a reference to the global object. So the
identifier resolution returns a reference to the global object. Then the
"open" property name is looked up on that object to acquire a reference
to the 2open" method, prior to its execution.

As a result both expressions execute the same function, but the second
is fractionally slower as it involves an additional step.
I suspect IE is much more lenient about this syntactical
mistake.
There is no syntactical mistake in either expression.

<snip> There is also a document.open() as well that is very
different ( ... .)
And when a document is on the scope chain that would be significant as
it would probably be above the global object and examined before it.
Some browsers, or scripting environments
might complain if you are not more specific.


When some browsers generates functions form source code provided as text
string values for event-handling attributes in the HTML source they
provide those functions with custom scope chains, and sometimes they do
place the document on those scope chains. Because browsers may or may
not provide these custom scope chains, and when they do they may or may
not place the document on that scope chain, it is safer to use -
window.open() - in code provided as an event handling attribute in the
HTML source. In normal javascript contexts the scope chain is
sufficiently clearly specified to allow the author to understand any
consequences of using - open() - instead of - window.open() - as
without action on the part of the author there would be no issue with
using - open() - (beyond the usual consideration of whether the browser
supports an open method at all), and it would be more efficient.

Richard.
Jul 23 '05 #20

P: n/a

Fox, I found many intriguing stuff in yr code.. what is this??
a href = '?design' what does the question mark do at the beginning of
this link? because in same tag you have "onclick = "return
handleClick('design')" so what does 'href=?design' do?? what does
handleClick do?? what is 'es' in yr code?? have not found a declaration
for it.. (as in 'es("content").height = 234;'

#design, #programming, etc. have a positiong of top:0; left:0;?????
it's like they're inside 'content' div, but in html code they're not
inside 'content' div.. ok, well.. great design either way.. :) Frances
Fox wrote:
Frances Del Rio wrote:
Fox, look what I did with your divs for netscape:

http://www.francesdelrio.com/fox/

heh heh... this is too cool.. I love your that image, it's beautiful...

Thank you! But that site is old and showing its age (I haven't updated
it in a few years...) I left the transparencies out for Mozilla browsers
back then because of severe performance degradation.

Check out http://site-creations.com instead... It still "plays" better
in IE, but Mozilla is coming along (finally). Also, for a really nice
bit of dhtml, check out the HSL Color Schemer under the tools menu
(there's a link for the instructions under the color picker - one new
feature not explained in the instructions - you are able to type an HTML
RGB color in the Main color text box, and hit Enter to set a new color.)

Fox
************
<snipped>


Jul 23 '05 #21

P: n/a
On Sat, 25 Sep 2004 18:58:46 -0500, fox <fo*@fxmahoney.com> wrote:

[snip]
<noscript>
<h3>This site requires JavaScript...</h3>
Why H3? You're not using headings for font size and presentation, are you?
</noscript>


Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #22

P: n/a
On Sat, 25 Sep 2004 21:14:05 -0400, Frances Del Rio <fd***@yahoo.com>
wrote:

[snip]
it even works in that very quirky broswer called 'Opera'...)


What exactly is "quirky" about Opera? It's one of the best browsers
available, in my opinion.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #23

P: n/a
On Mon, 27 Sep 2004 11:59:36 GMT, Michael Winter wrote:
it even works in that very quirky broswer called 'Opera'...)


What exactly is "quirky" about Opera? It's one of the best browsers
available, in my opinion.


Every browser has its quirks Mike.

Just about every UA with Java 1.4 installed will render this page reliably,
<http://www.physci.org/test/lnf/fullwnd5.html>
...but Opera leaves rendering artifacts (possibly) related to
the exact size of the applet. More details and test results here.
<http://www.physci.org/test/lnf/>

Of course, I'd love to add a row to the results table
reporting that a late version of Opera has fixed the problem.

( I also struck another Opera/Java interaction quirk
when a Java *developer* reported 'yahoo games' ceased
working ..but that turned out to be they had the pop-up
blocker enabled and that was killing new Java windows
and reporting it in the 'killed pop-up' stats.. Now,
I'll make no further reference to that.. ;-)

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #24

P: n/a
On Mon, 27 Sep 2004 12:40:31 GMT, Andrew Thompson <Se********@www.invalid>
wrote:
On Mon, 27 Sep 2004 11:59:36 GMT, Michael Winter wrote:
it even works in that very quirky broswer called 'Opera'...)
What exactly is "quirky" about Opera? It's one of the best browsers
available, in my opinion.


Every browser has its quirks Mike.


I realise that, but Frances seemed to imply that Opera is awkward to
script.
Just about every UA with Java 1.4 installed will render this page
reliably,
<http://www.physci.org/test/lnf/fullwnd5.html>
..but Opera leaves rendering artifacts (possibly) related to
the exact size of the applet. More details and test results here.
<http://www.physci.org/test/lnf/>


So it does. Have you reported that to Opera Software?

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #25

P: n/a
fox wrote:
Eli wrote:
On Sat, 25 Sep 2004 18:30:21 -0400, Frances Del Rio <fd***@yahoo.com>
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(this)">
....

// the JS:

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

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

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


Or:

<url: http://jibbering.com/faq/#FAQ4_37 />

Now if you can control the chrome of the new window via JavaScript (because
the user is not overriding your choices) you will control the chrome of the
new window.

If you can not control the chrome of the new window (because JavaScript is
disabled or unavailable), you will most likely still get a new window
because of the target attribute of the <form>.

However, I can configure my browser to ignore both the window.open() and the
target attribute of the <form>, for me, the form would post into the current
window.

The <noscript></noscript> block wouldn't help prevent this because
JavaScript _is_ enabled on my browser, I'm just choosing to ignore you
attempts to open a new window. Using <noscript></noscript> as an alternative
to a script-dependant page (such as one that does <form>.submit()) indicates
a lack of understanding of current browser technology and usage patterns.

There are no longer simply two choices: 1) browser with JavaScript enabled
that you can fully control and 2) brower with no JavaScript
available/enabled.

There are many, many choices: 1) browsers that have JavaScript enabled and
block all new windows with no alternative behaviour (in which case both
window.open() and target would simply fail and the form would be posted with
no response possible), 2) browsers that have JavaScript enabled and allow
new windows, but prevent your choice of chrome (the window may appear a
different size or position than you are expecting), 3) browsers with
JavaScript enabled, but which ignore attempts at both window.open() and
target attributes and open everything in the current window (no new window
ever opens, so if you want to communicate between the opener and the opened
window, you'll have a hard time doing that), etc etc

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #26

P: n/a
Fox
Michael Winter wrote:
On Sat, 25 Sep 2004 18:58:46 -0500, fox <fo*@fxmahoney.com> wrote:

[snip]
<noscript>
<h3>This site requires JavaScript...</h3>

Why H3? You're not using headings for font size and presentation, are you?


It's bold... it's medium... it's simple... it's enough.
</noscript>

Mike

Jul 23 '05 #27

P: n/a
On Mon, 27 Sep 2004 16:07:10 -0500, Fox <fo*@fxmahoney.com> wrote:
Michael Winter wrote:
On Sat, 25 Sep 2004 18:58:46 -0500, fox <fo*@fxmahoney.com> wrote:
<noscript>
<h3>This site requires JavaScript...</h3>


Why H3? You're not using headings for font size and presentation, are
you?


It's bold... it's medium... it's simple... it's enough.


And it's abuse of an element for no reason: the styling isn't even
necessary. HTML gives structure and meaning to a document, not
presentation.

If you really felt the need to tweak how the text was shown, use:

<style type="text/css">
noscript p {
font-size: 120%;
font-weight: bold;
}
</style>

<!-- ... -->

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

How is that complicated? Show best practice, not laziness.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #28

P: n/a
On Mon, 27 Sep 2004 12:55:39 GMT, Michael Winter wrote:
On Mon, 27 Sep 2004 12:40:31 GMT, Andrew Thompson <Se********@www.invalid>
wrote:
On Mon, 27 Sep 2004 11:59:36 GMT, Michael Winter wrote:
it even works in that very quirky broswer called 'Opera'...)

What exactly is "quirky" about Opera? It's one of the best browsers
available, in my opinion.


Every browser has its quirks Mike.


I realise that, but ..Opera is awkward to script.


<snip tangent re Java>
<http://www.physci.org/test/lnf/>


So it does. Have you reported that to Opera Software?


(sighs) After recent experiences with bug reporting
to Mozilla that resulted in no action other than an
'auto-responder' acknowledgement and posting my best
email address to an openly browseable web-page, I had
been rather discouraged at submitting bug reports to
makers of UA's.

But I tried again, with Opera. This time I got..

"All bug reports are read and handled by our staff.
However, please note that you will not receive a
personal reply to the bug report unless we need
more information to fix the bug.

We will not be able to respond to questions and queries
through the bug tracking system."

Now, I'm curious to find out exactly what the second
part means. What 'bug tracking system' I could find
no reference to it in links? Or does that actually mean
"We will not be able to respond to questions and queries
through any (non existent) bug tracking system"

Since they did not send me any auto-reponse to confirm
the receipt of the bug, I am left wondering even how to
track it. (Though they did offer a nice address where
they invited me to add anything I forgot BUT NOTHING MORE)

Do you have any experience with their system Mike?

Hopefully this time, my email address will not end up
on their bloody web-site though. (grumble, grizzle..)

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #29

P: n/a
On Tue, 28 Sep 2004 03:31:35 GMT, Andrew Thompson <Se********@www.invalid>
wrote:
On Mon, 27 Sep 2004 12:55:39 GMT, Michael Winter wrote:
[snip]
I realise that, but ..Opera is awkward to script.


Hey! That's kind of misleading, isn't it? :P

[snip]
Now, I'm curious to find out exactly what the second
part means. What 'bug tracking system' I could find
no reference to it in links? Or does that actually mean
"We will not be able to respond to questions and queries
through any (non existent) bug tracking system"


The questions and queries part is probably referring to the fact that they
have other support systems: forums, e-mail, mailing lists, and their own
news server.

As to the existence of the mythical tracking system, I haven't seen it
either. I was thinking about asking someone who quoted a bug by number,
but I didn't in the end.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #30

P: n/a
On Tue, 28 Sep 2004 08:01:14 GMT, Michael Winter wrote:
On Tue, 28 Sep 2004 03:31:35 GMT, Andrew Thompson wrote:
On Mon, 27 Sep 2004 12:55:39 GMT, Michael Winter wrote:
[snip]
I realise that, but ..Opera is awkward to script.


*
Hey! That's kind of misleading, isn't it? :P
* Who said that? [ :D ]
[snip]
Now, I'm curious to find out exactly what the second
part means. What 'bug tracking system' I could find
no reference to it in links? Or does that actually mean
"We will not be able to respond to questions and queries
through any (non existent) bug tracking system"
The questions and queries part is probably referring to the fact that they
have other support systems: forums, e-mail, mailing lists, and their own
news server.


Yeah, yeah, yeah! But the thing is, it is not like I want to enter
a lifelong relationship with the makers of Opera.

Heck, I am already a subscriber to 10 unmoderated usenet news groups,
the Sun developer forums, the 2Flyer screensaver forums, three mailing
lists and the webmaster of 4(+) sites. *Enough* already!

All I want (from Opera, and forgetting world peace, the million
bucks and the yacht for the moment) is a bug tracking system.
As to the existence of the mythical tracking system, I haven't seen it
either. I was thinking about asking someone who quoted a bug by number,
but I didn't in the end.


If you hear further word of it, let me know.

<TTP>
In the meantime, I am happy to post problems I have with Opera in
publicly searchable archives and in web pages (also publicly searchable)
on my site. So, in the spirit of 'tracking', here ya' go Opera..
<http://google.com/search?as_sitesearch=www.physci.org&as_q=Opera>
<http://google.com/groups?as_epq=Opera&as_ugroup=comp.lang.java*&as_u authors=andrew+thompson>
<http://google.com/groups?as_epq=Opera&as_ugroup=comp.infosystems.www .*&as_uauthors=andrew+thompson>
</TTP> ;-)

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #31

P: n/a
On Tue, 28 Sep 2004 08:01:14 GMT, "Michael Winter"
<M.******@blueyonder.co.invalid> wrote:
As to the existence of the mythical tracking system, I haven't seen it
either. I was thinking about asking someone who quoted a bug by number,
but I didn't in the end.


They don't publish public bugs, this isn't unusual, it's a closed
source product of course, you can report bugs and you do get a bug
report number back - but that's as far as it goes in public, so you
can get public bug numbers, maybe you should just put a wrapper around
the bug system that logs them publically aswell as going to Opera...

I've said it before, but closed source bug tracking systems should
always report a number, and they should list in the release notes if
it's been fixed - just listing numbers like this doesn't reveal any
details of the bugginess of the product, but it does encourage users
to report bugs, as they can find out when they're fixed.

Jim.
Jul 23 '05 #32

P: n/a
Andrew Thompson <Se********@www.invalid> writes:
Do you have any experience with their system Mike?


Well, I'm not Mike, but I have reported a few Opera bugs. If you want
personal feed-back, you must use either their forums or their
newsgroups. I only read the newsgroups, and wrt. bugs, I just ask if
it is a known bug. Sometimes I just report it without asking.

It's usually obscure Javascript bugs (like obj[""] not working
properly - that was one of the less obscure ones :), and they are
usually fixed in the next release.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #33

This discussion thread is closed

Replies have been disabled for this discussion.