Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Submit form from child -> parent windows
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 21 December 2004 :  15:39:22  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I thought this would be easy, but looking over references on the internet I can only find ways to sumit a form thats in the parent window by pressing the submit button in the child window.

Thats not what I want to do.

What I want to do is submit a form thats in the child window, to whatever page is currently loaded in the parent window...

if any of this makes sense... anyway, I'll keep looking.

-Stim

Spooky
Development Team Member

New Zealand
320 Posts

Posted - 21 December 2004 :  16:12:57  Show Profile  Visit Spooky's Homepage
If you are refering to the upload still, take a look at the example here :

http://www.frontpagewebmaster.com/m-236138/tm.htm
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 21 December 2004 :  16:21:11  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
no, nothign to do with upload

I just want to submit the form in a child window, to a page in the parent window. text form. nothing more

I tried
<form method="post" action="sumbmitto.asp" target="_parent">

That didnt work

-Stim

Edited by - Da_Stimulator on 21 December 2004 16:35:19
Go to Top of Page

rasure
Junior Member

289 Posts

Posted - 21 December 2004 :  16:40:18  Show Profile  Visit rasure's Homepage
Im not sure if this is of any use to you...
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20584327.html

Psychic & Spiritual Development Resources
Go to Top of Page

kacalapy
Starting Member

5 Posts

Posted - 21 December 2004 :  16:44:33  Show Profile
for this you need to use java script.

in parent window you use window.open(url)

then in the opened window you use something like this:

parent.opener.document.form1.controlName.value = somevalue

parent.opener.document.form1.controlName.value... will refer to parent page control (make this a hidden text box if you dont want to show the value)

somevalue.. is a value to pass back to parent window
Go to Top of Page

Spooky
Development Team Member

New Zealand
320 Posts

Posted - 21 December 2004 :  19:27:48  Show Profile  Visit Spooky's Homepage
Yes, but it demonstrates the same requirement
The upload page has a form.

You load a child window, enter in the form details and post the value back to the parent window.

It may have the code you need.
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 21 December 2004 :  20:57:57  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
pah... screw it I gave up. I'll just deal with one window

-Stim
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 22 December 2004 :  05:17:18  Show Profile  Send pdrg a Yahoo! Message
Just fyi, there was a recent tranche of vulns announced over windows being able to control content in other windows (ie, firefox, safari, etc - a fundemental vuln, not browser-specific) http://secunia.com/multiple_browsers_window_injection_vulnerability_test (demo available)

Whilst not a problem for now, this may become a problem as different browser vendors decide how to address it - so multi-window apps may work inconsistently accross browsers in the future. By sticking with a 1-window solution, you're on safer ground.

hth
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 22 December 2004 :  22:14:04  Show Profile
Here's a tidbit from Experts' Exchange:
quote:


<html>
  <head>
    <script>
      function setForm(frameName,formName,targetFrame,actionLink) {
        tForm = window.open('', frameName).document.forms[formName];
        tForm.Action.value = actionLink;
        tForm.target = targetFrame;
        tForm.submit();
      }
    </script>
  </head>
  <body onLoad="setForm('iFrameA','Form','iFrameB','action1');setForm('iFrameA','Form','iFrameC','action2');">
    <form id=Form name=Form method=post action=form.cgi target=zero>
      <input id=username name=username type=hidden value="">
      <input id=password name=password type=hidden value="">
      <input id=Action name=Action type=hidden value="">
    </form>
  </body>
</html>

Oh, and you have to rename your hidden field from action to Action.

By the way, to give a regular window a name to be used as target for your submits assign the name like this:
window.name = "myWindowName";



According to the author and others who are testing this, it works in all browsers.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07