[js] vanuit 2e window posten naar 1ste

Pagina: 1
Acties:

  • chuxiej
  • Registratie: Februari 2001
  • Laatst online: 13-07-2020
Hoe kan ik vanuit een popup geopend door pagina 1
iets in een textarea of pagina 1 posten?

ik dacht zoiets:
function close_add(info)
{
parent.info_form.info.value = info;
window.close();
}

maar dat lukt niet :(

www.dannyhiemstra.nl


Verwijderd

In de gewone pagina (hier doc1.html) :
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<html>
<head>
<script language="JavaScript"><!--
function newWindow(file,window) {
    msgWindow=open(file,window,'resizable=no,width=200,height=400');
    if (msgWindow.opener == null) msgWindow.opener = self;
}
//--></script>
</head>
<body>
<form name="outputForm1">
<input type="button" value="Open doc2.html into window2" onClick="newWindow('doc2.html','window2')">
<br><input name="outputField1" type="text" value="">
<br><input name="outputField2" type="text" value="">
</form>
</body>
</html>

In je popup (Hier doc2.html) :
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<html>
<head>
<script language="JavaScript"><!--
function setForm() {
    opener.document.outputForm1.outputField1.value = document.inputForm1.inputField1.value;
    opener.document.outputForm1.outputField2.value = document.inputForm1.inputField2.value;
    self.close();
    return false;
}
//--></script>
</head>
<body>
<form name="inputForm1" onSubmit="return setForm();">
<br><input name="inputField1" type="text" value="">
<br><input name="inputField2" type="text" value="">
<br><input type="submit" value="Update opener">
</form> 
</body>
</html>

  • disjfa
  • Registratie: April 2001
  • Laatst online: 12-05 15:11

disjfa

be

of sneller: window.parent.location='blabla' :)

disjfa - disj·fa (meneer)
disjfa.nl