You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Srinivas Rao <sr...@yahoo.com> on 2004/07/01 06:23:38 UTC
Getting the values from Popup window to Parent window if Multiple text fields in parent window
Hi guys,
I am facing samll problem , it's a simple one but i don't know what is the wrong i am doing ...
Please help me..
My problem is ...
I have parent window and child window (ie popup window)..If i entered
the value into text field to popup window then the value come to the parent window if i closed the child window. Here it is working when single file but if it is multiple files,it's not working .I thing in child window cannot identify the relevant text field.
the code is here .....
This is Parent window code.........
function showList() {
alert("Call Show List");
sList = window.open("/MTProd/ps/Supervisorcomment.jsp", "list", "width=750,height=510");
}
Chile window Code......
function append()
{
alert(window.opener.document.supervisorDeskActionForm.getElementById("stockBox").value);
document.getElementById("comment").value=
window.opener.document.supervisorDeskActionForm.getElementById("stockBox").value;
}
function pickinf() {
if (window.opener & !window.opener.closed)
{
window.opener.document.supervisorDeskActionForm.stockBox.value
= document.getElementById("comment").value;
}
window.close();
}
This is the code ....
Please tell me what is the wrong i am doing now...
Thanks to replay to me.....
Thanks
Srinivas.
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: Getting the values from Popup window to Parent window if Multiple text fields in parent window
Posted by Henrique VIECILI <vi...@softplan.com.br>.
If your filefields have all the same id or name you will get an array of them, then you should access them like an array.
By example:
HTML:
File 1: <input type="file" id="myFile" />
...
File n: <input type="file" id="myFile" />
JAVASCRIPT
var files = document.getElementById("myFile");
for( i = 0; i < files.length; i++)
alert(files[i].value);
Henrique Viecili
----- Original Message -----
From: Srinivas Rao
To: Struts Users Mailing List
Sent: Thursday, July 01, 2004 1:23 AM
Subject: Getting the values from Popup window to Parent window if Multiple text fields in parent window
Hi guys,
I am facing samll problem , it's a simple one but i don't know what is the wrong i am doing ...
Please help me..
My problem is ...
I have parent window and child window (ie popup window)..If i entered
the value into text field to popup window then the value come to the parent window if i closed the child window. Here it is working when single file but if it is multiple files,it's not working .I thing in child window cannot identify the relevant text field.
the code is here .....
This is Parent window code.........
function showList() {
alert("Call Show List");
sList = window.open("/MTProd/ps/Supervisorcomment.jsp", "list", "width=750,height=510");
}
Chile window Code......
function append()
{
alert(window.opener.document.supervisorDeskActionForm.getElementById("stockBox").value);
document.getElementById("comment").value=
window.opener.document.supervisorDeskActionForm.getElementById("stockBox").value;
}
function pickinf() {
if (window.opener & !window.opener.closed)
{
window.opener.document.supervisorDeskActionForm.stockBox.value
= document.getElementById("comment").value;
}
window.close();
}
This is the code ....
Please tell me what is the wrong i am doing now...
Thanks to replay to me.....
Thanks
Srinivas.
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com