473,563 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.l b1.value;
name = self.window.nam e;
if(name == "CMT1")
{
window.opener.d ocument.main_fo rm.comment_1_tb .value = x;
}

if(name == "CMT2")
{
window.opener.d ocument.main_fo rm.comment_2_tb .value = x;
}

if(name == "CMT3")
{
window.opener.d ocument.main_fo rm.comment_3_tb .value = 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.d ocument.main_fo rm.comment_3_tb .value = x;

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

i now have this line...
window.opener.d ocument.main_fo rm.comment_3_tb .value = x;

but i need it to be...
window.opener.d ocument.main_fo rm.[self.window.nam e].value = x;
(or whatever the syntax is correct)

please advise....

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

i now have this line...
window.opener.d ocument.main_fo rm.comment_3_tb .value = x;

but i need it to be...
window.opener.d ocument.main_fo rm.[self.window.nam e].value = x;
(or whatever the syntax is correct)


window.opener.d ocument.forms['main_form'].elements[self.window.nam e].value=x;


--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript 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
6543
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 form on the popup window is this:
3
24674
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 situation is: A main window opens child windows one at a time as the user requests, each with its own name. The user may click in any child window...
2
1795
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 frameset in the opener window. I started with something like this (what happens when the considions are met already works):
4
10483
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 description and a class_id (stored in the value attribute of each option). The user will then select a class from the drop-down list. What I want...
5
2848
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 the result to main page (I mean, update the parent page). My popup form looks like this: <form name="form1" action="run.php" method="get"...
1
4838
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 nothing I have found solves this silly little problem. Background ---------- I have been assigned a poorly-designed site to SEO. It has a...
1
2107
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 accept those changes. This is where the transter of the value should be. It could also be done when I close the popup form (whichever is easier). Once...
2
4002
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
1425
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 sender, EventArgs e) { ...
0
7579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7876
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7941
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6235
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5201
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.