T
Tony Farrell
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.value = x;
}
if(name == "CMT2")
{
window.opener.document.main_form.comment_2_tb.value = x;
}
if(name == "CMT3")
{
window.opener.document.main_form.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.document.main_form.comment_3_tb.value = 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.value = 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
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.value = x;
}
if(name == "CMT2")
{
window.opener.document.main_form.comment_2_tb.value = x;
}
if(name == "CMT3")
{
window.opener.document.main_form.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.document.main_form.comment_3_tb.value = 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.value = 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