473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Setting the value of window.opener from popup window name

Hi Everyone -

I have a data entry form that allows the user to click a button
and have that button popup a list of available values -

the code on the popup window uses the name of the form
to determine what field to populate on the opener...

function sendComment()

{
var x
x = document.canned_comment_form.lb1.value;
name = self.window.name;
if(name == "CMT1")
{
window.opener.document.main_form.comment_1_tb.valu e = x;
}

if(name == "CMT2")
{
window.opener.document.main_form.comment_2_tb.valu e = x;
}

if(name == "CMT3")
{
window.opener.document.main_form.comment_3_tb.valu e = x;
}

close();
}
Now - I have switched the data entry to a dynamic type of form -
where each section can have multiple comment boxes -
so the question i have is ....

how do i build the
window.opener.document.main_form.comment_3_tb.valu e = x;

line to replace the .comment_3_tb. with
the
name = self.window.name;
in other words -

i now have this line...
window.opener.document.main_form.comment_3_tb.valu e = x;

but i need it to be...
window.opener.document.main_form.[self.window.name].value = x;
(or whatever the syntax is correct)

please advise....

thanks
tony
Jul 23 '05 #1
1 4995
Tony Farrell wrote:
Hi Everyone -
<snip>

i now have this line...
window.opener.document.main_form.comment_3_tb.valu e = x;

but i need it to be...
window.opener.document.main_form.[self.window.name].value = x;
(or whatever the syntax is correct)


window.opener.document.forms['main_form'].elements[self.window.name].value=x;


--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2

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

Similar topics

1
by: Person | last post by:
I have a popup window with a form: The popup window is opened like this: <SCRIPT LANGUAGE=javascript> window.open('primos.html', 'primos', config='height=300, width=400') </SCRIPT> The...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
2
by: JPL Verhey | last post by:
(i hope somebody (else) will read and have an idea! Thnx) Hi, With a script in a popup window, I want to check if certain content is present in a page loaded into the frame "main" of the...
4
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...
5
by: Hemanth | last post by:
Hello there, I'm running a script that opens a popup window (which is basically a form with checkboxes and a submit button). When I click the submit button I want to run a PHP script and target...
1
by: Jessica | last post by:
Hi, I'm sorry if this has been asked before. I'm a designer and occasional javascript hacker, not a javascript writer. I cannot believe I have spent over 4 hours searching for this on Google and...
1
by: VMI | last post by:
How can I transfer some text from a Textbox in a popup window to the main webform that opened that popup? The popup webform will have some type of Button that the user will click in order to...
2
by: jodleren | last post by:
Hi! I use this to read on the value of my "parent" window. stemp=window.opener.document.forms.workgroup.value; Works well. Say, I'd like to add an items to that, and select it?
1
by: pandharinath | last post by:
I want to display fields(row) selected from grid in popup window to textboxes in Opener window. I have written code as follows : Main Opener window protected void Button1_Click(object...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.