Author |
Topic |
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 21 December 2004 : 15:39:22
|
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 |
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 21 December 2004 : 16:21:11
|
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 |
|
|
rasure
Junior Member
289 Posts |
|
kacalapy
Starting Member
5 Posts |
Posted - 21 December 2004 : 16:44:33
|
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
|
|
|
Spooky
Development Team Member
New Zealand
320 Posts |
Posted - 21 December 2004 : 19:27:48
|
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. |
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 21 December 2004 : 20:57:57
|
pah... screw it I gave up. I'll just deal with one window |
-Stim |
|
|
pdrg
Support Moderator
United Kingdom
2897 Posts |
Posted - 22 December 2004 : 05:17:18
|
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 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 22 December 2004 : 22:14:04
|
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. |
|
|
|
Topic |
|