473,666 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get dynamic formname and return value to opener

Hi,

I have 6 forms being generated using coldFusion, they are named
special1, special2 special3 and so on.. in these forms I have a link to
open a new window.

I am trying to pickup the formname passed along to the new window.. the
window opener function is:

<SCRIPT LANGUAGE = "JavaScript ">
<!--

function newupload()
{

var
newWind=window. open(imageuploa d.cfm,'remote', 'width=450,heig ht=430,scrollba rs=yes,status=y es');
if (newWind.opener == null)
{ newWind.opener = window; }

}

//-->
</SCRIPT>

the caller: <A HREF = "javascript:new upload('#formna me#',
'special_image' )">Upload New Image</A>

... this is working, then in the new window after some processing I want
to return a value to the opener..

this is what I need but I dont know how to get it..

window.opener.d ocument."Formna me".value

after looking around this is what I've been trying
<SCRIPT LANGUAGE="JavaS cript">
<!--
function setimagename(iN ame)
{

var argstr = location.search .substring(1, location.search .length)
var args = argstr.split('? ');
var ci = unescape(args[0]);
document.write( ci); // prints it in the HTML

/*opener.documen t.Special1.spec ial_image.value =iName;*/

/*close();*/

}
//-->
</SCRIPT>
but it doesn't work.. no error just doesn't work (using ie 6)
Any Ideas welcome..
Dave

Feb 2 '06 #1
5 3156
Hello Dave,

Can you give an HTML version of the page, it would be easier to assist if
the problem is seen.

--
Elias
<dr****@canoema il.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Hi,

I have 6 forms being generated using coldFusion, they are named
special1, special2 special3 and so on.. in these forms I have a link to
open a new window.

I am trying to pickup the formname passed along to the new window.. the
window opener function is:

<SCRIPT LANGUAGE = "JavaScript ">
<!--

function newupload()
{

var
newWind=window. open(imageuploa d.cfm,'remote', 'width=450,heig ht=430,scrollba rs=yes,status=y es');
if (newWind.opener == null)
{ newWind.opener = window; }

}

//-->
</SCRIPT>

the caller: <A HREF = "javascript:new upload('#formna me#',
'special_image' )">Upload New Image</A>

.. this is working, then in the new window after some processing I want
to return a value to the opener..

this is what I need but I dont know how to get it..

window.opener.d ocument."Formna me".value

after looking around this is what I've been trying
<SCRIPT LANGUAGE="JavaS cript">
<!--
function setimagename(iN ame)
{

var argstr = location.search .substring(1, location.search .length)
var args = argstr.split('? ');
var ci = unescape(args[0]);
document.write( ci); // prints it in the HTML

/*opener.documen t.Special1.spec ial_image.value =iName;*/

/*close();*/

}
//-->
</SCRIPT>
but it doesn't work.. no error just doesn't work (using ie 6)
Any Ideas welcome..
Dave

Feb 2 '06 #2
dr****@canoemai l.com wrote:
Hi,

I have 6 forms being generated using coldFusion, they are named
special1, special2 special3 and so on.. in these forms I have a link to
open a new window.

I am trying to pickup the formname passed along to the new window.. the
window opener function is:

<SCRIPT LANGUAGE = "JavaScript ">
<!--

function newupload()
{

var
newWind=window. open(imageuploa d.cfm,'remote', 'width=450,heig ht=430,scrollba rs=yes,status=y es');
if (newWind.opener == null)
{ newWind.opener = window; }

}

//-->
</SCRIPT>

the caller: <A HREF = "javascript:new upload('#formna me#',
'special_image' )">Upload New Image</A>

.. this is working, then in the new window after some processing I want
to return a value to the opener..

this is what I need but I dont know how to get it..

window.opener.d ocument."Formna me".value
function getFormNamesFro mOpener(){
var f=window.opener .document.forms ,ff=f.length,AR R=[];
while(ff--) {ARR.push(f[ff].name}
return ARR;
}
alert(getFormNa mesFromOpener() .join("/");


after looking around this is what I've been trying
<SCRIPT LANGUAGE="JavaS cript">
<!--
function setimagename(iN ame)
{

var argstr = location.search .substring(1, location.search .length)
var args = argstr.split('? ');
var ci = unescape(args[0]);
document.write( ci); // prints it in the HTML
I don't know what you're trying to do here but the following is equivalent:

function setimagename(iN ame){
document.write( unescape(locati on.search.subst ring(1));
}

Mick

/*opener.documen t.Special1.spec ial_image.value =iName;*/

/*close();*/

}
//-->
</SCRIPT>
but it doesn't work.. no error just doesn't work (using ie 6)
Any Ideas welcome..
Dave

Feb 2 '06 #3
sorry about the size but here is the page with the forms.. only 2 in
this example.. I'm trying to pass the formname in the urlstring to try
and acess..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Tyendina ga Computers - Virtual Office</title>
<link rel="STYLESHEET " type="text/css" href="../tc.css">

<SCRIPT LANGUAGE = "JavaScript ">
<!--

// 'imageupload.cf m?form='functio n to load the upload window.
function newupload()
{

theURL = "imageupload.cf m?id=" + special1;
var
newWind=window. open(theURL,'re mote','width=45 0,height=430,sc rollbars=yes,st atus=yes');
if (newWind.opener == null)
{ newWind.opener = window; }

}

//-->
</SCRIPT>
</head>

<body bgcolor="#fffff f" leftmargin="0" marginwidth="0" rightmargin="0" >
<table cellpadding="0" cellspacing="0" border="1" width="100%">
<tr>
<td align="center"> <img src="images/logo.gif" width="329" height="64"
alt="" border="0"><br> <img src="images/spacer.gif" width="1"
height="10" alt="" border="0"></td>
</tr>
<tr>
<td background="ima ges/bg_blue.gif"><i mg src="images/spacer.gif"
width="1" height="1" alt="" border="0"></td>
</tr>
<tr>
<td background="ima ges/bg_red.gif"><im g src="images/spacer.gif"
width="10" height="1" alt="" border="0"><img src="images/vo.gif"
width="157" height="31" alt="" border="0"></td>
</tr>
<tr>
<td bgcolor="#fffff f"><img src="images/spacer.gif" width="1"
height="1" alt="" border="0"></td>
</tr>
<tr>
<td background="ima ges/bg_blue.gif" height="350" valign="top"><i mg
src="images/spacer.gif" width="1" height="1" alt="" border="0"><br>
<p>&nbsp;&nbsp; &nbsp;&nbsp; <a href="index.htm " class="vo">Main Menu</a>
<table cellpadding="3" cellspacing="0" border="0" align="center">
<tr>
<td class="vohdr" colspan="2">Edi t Specials<br><br ></td>
</tr>
<tr>
<td colspan="2" class="vohdr">< b>Information Below will appear on
the <a href="../comp_special.cf m" class="vohdr">S pecials
Page</a></b></td>
</tr>
<tr>
<td bgcolor="#F7F3F 3" width="600"><br >

<form name="special1" action="updateS pecials.cfm"
method="post">
<table width="600" cellpadding="3" cellspacing="0"
border="1">


<input type="hidden" name="id" value="1">
<tr>
<td class="text">Vi sible on Page:</td>
<td class="text"><i nput type="checkbox" name="special_v isible"
</td>

</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">T itle:</td>
<td><input type="text" name="special_t itle"
value="IBM Refurbished Desktops" class="input"></td>
</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">P rice:</td>
<td><input type="text" name="special_p rice"
value="550.50" class=".dollari nput"></td>
</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">E xtra Price Info:</td>
<td><input type="text" name="extra_lab el"
value="$429.00 without monitor" class="input"></td>
</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">I ncludes:</td>
<td><input type="text" name="includes" value="Add
Corel WP Office Suite & MacAfee Antivirus for $29.00"
class="input"></td>
</tr>

<tr>
<td class="text" valign="top" align="right">S pecial
Offer Details List:</td>
<td><textarea name="special_d etails" cols="20"
rows="10" wrap="virtual" class="comments 2"><li>IBM P4, 2.0GHz
<li>256MB RAM
<li>40GB/FDD
<li>New CDRW
<li>Keyboard
<li>Mouse & Speakers
<li>10/100 NIC
<li>New 17" Monitor
<li>Windows 2000 Professional
<li>Test item</textarea></td>
</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">I mage Name </td>
<td><input type="text" name="special_i mage"
value="empty.jp g">&nbsp;<A HREF = "javascript:new upload('special 1',
'special_image' )">Upload New Image</A></td>
</tr>
<tr>
<td align="center" colspan="2"><in put type="submit"
name="btn" value="Update"> </td>
</tr>

</table>
</form>
<p></p>

<form name="special2" action="updateS pecials.cfm"
method="post">
<table width="600" cellpadding="3" cellspacing="0"
border="1">


<input type="hidden" name="id" value="2">
<tr>
<td class="text">Vi sible on Page:</td>
<td class="text"><i nput type="checkbox" name="special_v isible"
checked></td>
</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">T itle:</td>
<td><input type="text" name="special_t itle"
value="Lexmark Z615" class="input"></td>
</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">P rice:</td>
<td><input type="text" name="special_p rice"
value="49.00" class=".dollari nput"></td>
</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">E xtra Price Info:</td>
<td><input type="text" name="extra_lab el" value=""
class="input"></td>
</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">I ncludes:</td>
<td><input type="text" name="includes" value="Factory
Refurbished Printer" class="input"></td>
</tr>

<tr>
<td class="text" valign="top" align="right">S pecial
Offer Details List:</td>
<td><textarea name="special_d etails" cols="20"
rows="10" wrap="virtual" class="comments 2"><li>Black & colour
cartridges
<li>1 year manufacturers warranty
</textarea></td>
</tr>
<tr>
<td class="text" valign="top" width="150"
align="right">I mage Name </td>
<td><input type="text" name="special_i mage"
value="z615.jpg ">&nbsp;<A HREF = "javascript:new upload('special 2',
'special_image' )">Upload New Image</A></td>
</tr>
<tr>
<td align="center" colspan="2"><in put type="submit"
name="btn" value="Update"> </td>
</tr>

</table>
</form>
<p></p>

</table><br><br></td>
</tr>
</table>
</body>
</html>

Feb 2 '06 #4
Hi Mick,

Thx for the reply, 1 more thing

what I need to do is really get this line..

opener.document .Special1.speci al_image.value= iName;

when I hardcode that it returns the proper value to the opener, how
would i use your function to get the value in there..

I tried this.. but got an error

<SCRIPT LANGUAGE="JavaS cript">
<!--

function getFormNamesFro mOpener(){
var f=window.opener .document.forms ,ff=f.length,AR R=[];
while(ff--) {ARR.push(f[ff].name}
return ARR;

}

function setimagename(iN ame)
{

opener.document .getFormNamesFr omOpener().spec ial_image.value =iName;

/*close();*/

}
//-->
</SCRIPT>

Feb 2 '06 #5
dr****@canoemai l.com wrote:
Hi Mick,

Thx for the reply, 1 more thing

what I need to do is really get this line..

opener.document .Special1.speci al_image.value= iName;

when I hardcode that it returns the proper value to the opener, how
would i use your function to get the value in there..

I tried this.. but got an error

<SCRIPT LANGUAGE="JavaS cript">
<!--

function getFormNamesFro mOpener(){
var f=window.opener .document.forms ,ff=f.length,AR R=[];
while(ff--) {ARR.push(f[ff].name}
return ARR;

}

function setimagename(iN ame)
{

opener.document .getFormNamesFr omOpener().spec ial_image.value =iName;

opener.document .forms[getFormNamesFro mOpener()[0]].special_image. value=iName;

or simply:

opener.document .forms[0].special_image. value=iName;

Mick

/*close();*/

}
//-->
</SCRIPT>

Feb 2 '06 #6

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

Similar topics

1
2550
by: D Mineer | last post by:
HEre is my code function passVal(p,q,r){ with (window.opener.form1) { bldr_cmpny.value=p bldr_cotel.value=q; bldr_lcse.value=r; } window.close(); }
4
2559
by: cwwilly | last post by:
Hello, Thanks for taking a look at this! Problem: I'm trying to pass multiple dynamic values between a slaveform and a masterform. The problem I'm having is on the slaveform I loop through multiple records and want two values depending on the row they select. slaveform: x=selected
4
4659
by: Pasquale | last post by:
Hello, I wondering if there is a way to dynamically update a select list with javascript from a database query without having to reload the page to update the list?
1
3426
by: Piotr | last post by:
I have popup window (window.open) where I put any value in input field. After submit I wan to to return to the main window and get value from popup window. How to close popup window and return to the main after submit?
7
2948
by: michael | last post by:
apologies in advance, as not only am i new to learning how to code javascript properly, i'm new to the groups posting thing... i am developing in firefox 1.0+, but will be working in an msie 6.0+ produciton environment ( not my choice, but when is it ever? ). the desired output is that when the end-user selects two radio buttons, one from each 'group', the form / page will open an alert window displaying the values of the radio buttons...
4
2692
by: JV | last post by:
I thought I once saw somewhere that a global variable, "xyz" for example, could be declared and used so that instead of using "document.formname.elementname.value" one could use "xyz.elementname.value" or use "xyz" in place of "document.formname" anytime a reference to a form element was made. Is this actually true or not? I'm going crazy trying to recall something that might not even exist! Thanks.
2
3071
by: thuythu | last post by:
Please help me.... I used and Javascript to view the data. But when i click button open a popup windows, then select data and click save button. The popup close and return the main page, but the textbox value in the main page is undefined ---------------------------------------- here are code main page: ------------------------------------------- <script language="JavaScript"> var thedata; var newwin; var thenumber; function...
4
4871
by: Michael Munch | last post by:
Hi I want to read the value of af text-field, create dynamic, in a form. Se below a small test-site to do that (but readning fails): I use the function Test_Read for reading the value from the dynamic create text-field "txtName". I thanks...
0
8448
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8552
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.