473,583 Members | 3,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

submiting to a parent window from a popup child window?

hi all,
quick question, how do you submit a form to a parent window from a
child popup window? i have the following and all online documentation
*suggests* that it should work but it does NOT:

// Parent window:
<script language="JavaS cript">
function popup(url, name)
{
window.open(url , name, "width=800,heig ht=600,scrollba rs=yes");
return false;
}
</script>
....
<form name=form1 method=post action=somethin g.php>
<input type=hidden name=h1 value='' >
<a href="#"
target="childWi ndowName" onclick="return popup('url.php' ,'Some
name');">Pop</a>
....
</form>

// Now in the child popup window
<script language="JavaS cript">
function handleSubmit(aV alue)
{
var myParent = opener.document .forms.form1;
myParent.h1.val ue=aValue;
myParent.submit (); // ERROR: Object doesn't support this property
or method
return true;
}
</script>
<a href=# onclick="handle Submit(2006);"> Submit</a>

i have spent a few hours searching online and all the examples
indicates that this example should work but it doesn't, not in IE or
FF. in FF, nothing happen and in IE, the following error show up:

Object doesn't support this property or method

any idea? thanks!

Jun 10 '06 #1
5 8031
anyone? any idea?

mi************* **@yahoo.com wrote:
hi all,
quick question, how do you submit a form to a parent window from a
child popup window? i have the following and all online documentation
*suggests* that it should work but it does NOT:

// Parent window:
<script language="JavaS cript">
function popup(url, name)
{
window.open(url , name, "width=800,heig ht=600,scrollba rs=yes");
return false;
}
</script>
...
<form name=form1 method=post action=somethin g.php>
<input type=hidden name=h1 value='' >
<a href="#"
target="childWi ndowName" onclick="return popup('url.php' ,'Some
name');">Pop</a>
...
</form>

// Now in the child popup window
<script language="JavaS cript">
function handleSubmit(aV alue)
{
var myParent = opener.document .forms.form1;
myParent.h1.val ue=aValue;
myParent.submit (); // ERROR: Object doesn't support this property
or method
return true;
}
</script>
<a href=# onclick="handle Submit(2006);"> Submit</a>

i have spent a few hours searching online and all the examples
indicates that this example should work but it doesn't, not in IE or
FF. in FF, nothing happen and in IE, the following error show up:

Object doesn't support this property or method

any idea? thanks!


Jun 12 '06 #2
First things first, both your pages (parent and child) must be under
the same domain and/or path. If this is the case then it could be that
you gave the window wrong names...
<form name=form1 method=post action=somethin g.php>
<input type=hidden name=h1 value='' >
<a href="#"
target="childWi ndowName" onclick="return popup('url.php' ,'Some
name');">Pop</a>
...
</form>

where does childWindowName reference to? is it necessary for it to be
there?

'Some name' shouldn't have any spaces in between, so you might want to
consider 'Some_name'

otherwise you could try the onsubmit attribute in form1

mi************* **@yahoo.com wrote: anyone? any idea?

mi************* **@yahoo.com wrote:
hi all,
quick question, how do you submit a form to a parent window from a
child popup window? i have the following and all online documentation
*suggests* that it should work but it does NOT:

// Parent window:
<script language="JavaS cript">
function popup(url, name)
{
window.open(url , name, "width=800,heig ht=600,scrollba rs=yes");
return false;
}
</script>
...
<form name=form1 method=post action=somethin g.php>
<input type=hidden name=h1 value='' >
<a href="#"
target="childWi ndowName" onclick="return popup('url.php' ,'Some
name');">Pop</a>
...
</form>

// Now in the child popup window
<script language="JavaS cript">
function handleSubmit(aV alue)
{
var myParent = opener.document .forms.form1;
myParent.h1.val ue=aValue;
myParent.submit (); // ERROR: Object doesn't support this property
or method
return true;
}
</script>
<a href=# onclick="handle Submit(2006);"> Submit</a>

i have spent a few hours searching online and all the examples
indicates that this example should work but it doesn't, not in IE or
FF. in FF, nothing happen and in IE, the following error show up:

Object doesn't support this property or method

any idea? thanks!


Jun 12 '06 #3
comments below...

Seige wrote:
First things first, both your pages (parent and child) must be under
the same domain and/or path. If this is the case then it could be that
you gave the window wrong names...
yes the parent and the child window are under the same domain and same
path.
<form name=form1 method=post action=somethin g.php>
<input type=hidden name=h1 value='' >
<a href="#"
target="childWi ndowName" onclick="return popup('url.php' ,'Some
name');">Pop</a>
...
</form>

where does childWindowName reference to? is it necessary for it to be
there?


it's not referenced anywhere. correct me if i am wrong (most likely),
target="childWi ndowName" is the name of the child window and is
required for a popup right? otherwise, i could have use something like
target=_blank

'Some name' shouldn't have any spaces in between, so you might want to
consider 'Some_name'
actually, it doesn't have space in the actual code. iti's my mistake to
have a space here

otherwise you could try the onsubmit attribute in form1

i suppose i could do that but i am more interested to find out why my
solution doesn't work in the first place where all online documentation
and code example suggests that it should. i think you are on the right
track that i must have some sort of name-reference thing mess up
between the child and the parent window but the thing is i can get a
reference of the parent window and setting hidden field variables and
such, it's just the submit() method keep saying it's not support


mi************* **@yahoo.com wrote:
anyone? any idea?

mi************* **@yahoo.com wrote:
hi all,
quick question, how do you submit a form to a parent window from a
child popup window? i have the following and all online documentation
*suggests* that it should work but it does NOT:

// Parent window:
<script language="JavaS cript">
function popup(url, name)
{
window.open(url , name, "width=800,heig ht=600,scrollba rs=yes");
return false;
}
</script>
...
<form name=form1 method=post action=somethin g.php>
<input type=hidden name=h1 value='' >
<a href="#"
target="childWi ndowName" onclick="return popup('url.php' ,'Some
name');">Pop</a>
...
</form>

// Now in the child popup window
<script language="JavaS cript">
function handleSubmit(aV alue)
{
var myParent = opener.document .forms.form1;
myParent.h1.val ue=aValue;
myParent.submit (); // ERROR: Object doesn't support this property
or method
return true;
}
</script>
<a href=# onclick="handle Submit(2006);"> Submit</a>

i have spent a few hours searching online and all the examples
indicates that this example should work but it doesn't, not in IE or
FF. in FF, nothing happen and in IE, the following error show up:

Object doesn't support this property or method

any idea? thanks!


Jun 12 '06 #4
Hmm... i'm clueless as to why this happen. Usually when something like
this happens, I would regard it as another "Browser-Securit-Issue" and
proceed with the workaround. (aka onsubmit)

mi************* **@yahoo.com wrote:
comments below...

Seige wrote:
First things first, both your pages (parent and child) must be under
the same domain and/or path. If this is the case then it could be that
you gave the window wrong names...


yes the parent and the child window are under the same domain and same
path.
> <form name=form1 method=post action=somethin g.php>
> <input type=hidden name=h1 value='' >
> <a href="#"
> target="childWi ndowName" onclick="return popup('url.php' ,'Some
> name');">Pop</a>
> ...
> </form>


where does childWindowName reference to? is it necessary for it to be
there?


it's not referenced anywhere. correct me if i am wrong (most likely),
target="childWi ndowName" is the name of the child window and is
required for a popup right? otherwise, i could have use something like
target=_blank

'Some name' shouldn't have any spaces in between, so you might want to
consider 'Some_name'


actually, it doesn't have space in the actual code. iti's my mistake to
have a space here

otherwise you could try the onsubmit attribute in form1


i suppose i could do that but i am more interested to find out why my
solution doesn't work in the first place where all online documentation
and code example suggests that it should. i think you are on the right
track that i must have some sort of name-reference thing mess up
between the child and the parent window but the thing is i can get a
reference of the parent window and setting hidden field variables and
such, it's just the submit() method keep saying it's not support


mi************* **@yahoo.com wrote:
anyone? any idea?

mi************* **@yahoo.com wrote:
> hi all,
> quick question, how do you submit a form to a parent window from a
> child popup window? i have the following and all online documentation
> *suggests* that it should work but it does NOT:
>
> // Parent window:
> <script language="JavaS cript">
> function popup(url, name)
> {
> window.open(url , name, "width=800,heig ht=600,scrollba rs=yes");
> return false;
> }
> </script>
> ...
> <form name=form1 method=post action=somethin g.php>
> <input type=hidden name=h1 value='' >
> <a href="#"
> target="childWi ndowName" onclick="return popup('url.php' ,'Some
> name');">Pop</a>
> ...
> </form>
>
> // Now in the child popup window
> <script language="JavaS cript">
> function handleSubmit(aV alue)
> {
> var myParent = opener.document .forms.form1;
> myParent.h1.val ue=aValue;
> myParent.submit (); // ERROR: Object doesn't support this property
> or method
> return true;
> }
> </script>
> <a href=# onclick="handle Submit(2006);"> Submit</a>
>
> i have spent a few hours searching online and all the examples
> indicates that this example should work but it doesn't, not in IE or
> FF. in FF, nothing happen and in IE, the following error show up:
>
> Object doesn't support this property or method
>
> any idea? thanks!


Jun 12 '06 #5
unfortunetly, onsubmit() won't work too because the form is not
submited so the event is never trigger. i did solve this prolbme by
using this:

// myParent.submit (); -- does NOT work
myParent.mySubm itButton.click( ); // this does work

by using the click() event, it does exactly what i need. i still have
no idea why submit() doesn't work.

Seige wrote:
Hmm... i'm clueless as to why this happen. Usually when something like
this happens, I would regard it as another "Browser-Securit-Issue" and
proceed with the workaround. (aka onsubmit)

mi************* **@yahoo.com wrote:
comments below...

Seige wrote:
First things first, both your pages (parent and child) must be under
the same domain and/or path. If this is the case then it could be that
you gave the window wrong names...


yes the parent and the child window are under the same domain and same
path.

> > <form name=form1 method=post action=somethin g.php>
> > <input type=hidden name=h1 value='' >
> > <a href="#"
> > target="childWi ndowName" onclick="return popup('url.php' ,'Some
> > name');">Pop</a>
> > ...
> > </form>

where does childWindowName reference to? is it necessary for it to be
there?


it's not referenced anywhere. correct me if i am wrong (most likely),
target="childWi ndowName" is the name of the child window and is
required for a popup right? otherwise, i could have use something like
target=_blank

'Some name' shouldn't have any spaces in between, so you might want to
consider 'Some_name'


actually, it doesn't have space in the actual code. iti's my mistake to
have a space here

otherwise you could try the onsubmit attribute in form1


i suppose i could do that but i am more interested to find out why my
solution doesn't work in the first place where all online documentation
and code example suggests that it should. i think you are on the right
track that i must have some sort of name-reference thing mess up
between the child and the parent window but the thing is i can get a
reference of the parent window and setting hidden field variables and
such, it's just the submit() method keep saying it's not support


mi************* **@yahoo.com wrote:
> anyone? any idea?
>
> mi************* **@yahoo.com wrote:
> > hi all,
> > quick question, how do you submit a form to a parent window from a
> > child popup window? i have the following and all online documentation
> > *suggests* that it should work but it does NOT:
> >
> > // Parent window:
> > <script language="JavaS cript">
> > function popup(url, name)
> > {
> > window.open(url , name, "width=800,heig ht=600,scrollba rs=yes");
> > return false;
> > }
> > </script>
> > ...
> > <form name=form1 method=post action=somethin g.php>
> > <input type=hidden name=h1 value='' >
> > <a href="#"
> > target="childWi ndowName" onclick="return popup('url.php' ,'Some
> > name');">Pop</a>
> > ...
> > </form>
> >
> > // Now in the child popup window
> > <script language="JavaS cript">
> > function handleSubmit(aV alue)
> > {
> > var myParent = opener.document .forms.form1;
> > myParent.h1.val ue=aValue;
> > myParent.submit (); // ERROR: Object doesn't support this property
> > or method
> > return true;
> > }
> > </script>
> > <a href=# onclick="handle Submit(2006);"> Submit</a>
> >
> > i have spent a few hours searching online and all the examples
> > indicates that this example should work but it doesn't, not in IE or
> > FF. in FF, nothing happen and in IE, the following error show up:
> >
> > Object doesn't support this property or method
> >
> > any idea? thanks!


Jun 13 '06 #6

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

Similar topics

9
48913
by: Randell D. | last post by:
Folks, I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a call to window.open As opposed to closing and re-opening new windows, I would prefer that when the user is finished reading the complete record,...
4
22184
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a description and a class_id (stored in the value attribute of each option). The user will then select a class from the drop-down list. What I want...
2
2485
by: Mark | last post by:
Any suggestions on how to go about generating a popup, giving the user a way of searching for something, and then taking their selection after closing the pop-up and populating the parent form with the selection from the child? I can do everything up until the point of having to populate the parent form with the selection from the child form. ...
4
2757
by: Earl Teigrob | last post by:
I am thinking about using a popup window to edit settings that will affect parent asp.net page. The data that is changed in the popup window will be saved to the datastore that is loaded and displayed by the parent page. In order to refresh the parent page, I would like to raise an event in the popup (child) page that is subscribed to by the...
1
11557
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all...
2
19223
by: Robert Degen | last post by:
Hello, I got a little problem. Seems very simple: * I want to open a popup window * Popup-window uses data from its father window. BUT a parent.window does NOT point to the real parents window. Alerting parent.window.location.href shows me, I'm at the wrong window location.
2
2742
by: epaetz | last post by:
Is there a way to decouple the linkage between a parent and a child window? Does the parent window have any sort of a collection that holds all the children that it has spawned? I want to break that connection from the parent side or the child side, it doesn't matter as long as the communication link is completely broken. I don't want...
2
9852
by: sanscrimson | last post by:
Hi! I just want to ask if it possible to call functions in parent window if the child window is created. Below is sample: //--------------------------------------------------------------------------------// <html> <head> <title></title> <script language="JavaScript"> var win;
1
3385
by: Andrew Hayes | last post by:
I have a parent page with a gridview, and a child page with a formview. Using the solution on velocityreviews: http://www.velocityreviews.com/forums/t80654-solution-raising-an-event-handler-postback-on-parent-window-from-popup-child-window-dialog-box.html I was able to create the Parent and Child Window custom controls and get them to...
0
7895
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
8182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8193
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
6579
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...
1
5701
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5374
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3843
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2333
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
1157
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.