Sorry for posting so far after but here is an example that I use:
<SCRIPT LANGUAGE = "JavaScript">
function SelectThis(IDVal, LNameVal, FNameVal, TitleVal, PhoneVal, DivVal,
EmailVal, OfficeVal, DeptVal, RegionVal)
{
var a = IDVal;
var b = LNameVal;
var c = FNameVal;
var d = TitleVal;
var e = PhoneVal;
var f = DivVal;
var g = EmailVal;
var h = OfficeVal;
var i = DeptVal;
var j = RegionVal;
self.opener.document.Volunteer.Emp_ID.value = a;
self.opener.document.Volunteer.LastName.value = b;
self.opener.document.Volunteer.FirstName.value = c;
self.opener.document.Volunteer.Title.value = d;
self.opener.document.Volunteer.Phone.value = e;
self.opener.document.Volunteer.Division.value = f;
self.opener.document.Volunteer.Email.value = g;
self.opener.document.Volunteer.Office.value = h;
self.opener.document.Volunteer.Department.value = i;
self.opener.document.Volunteer.Region.value = j;
window.close();
}
</SCRIPT>
Just be careful with the " ' " character in names or such like o'shea - javascript
does not like it. What i did was use Cf to replace it.
<INPUT TYPE = "button" class="buttoncolor" name="EmpID" VALUE = "Select"
onClick = "SelectThis('#ID#', '#Replace(LNAME, "'", "\'", "ALL")#',
'#Replace(F_NAME, "'", "\'", "ALL")#', '#TITLE_ID#', '#FULLNUM#', '#Replace(DIVNAME,
"'", "\'", "ALL")#', '#Replace(EMAIL_ADDR, "'", "\'", "ALL")#', '#Replace(OFFICE_NAME,
"'", "\'", "ALL")#','#Replace(DEPTNAME, "'", "\'", "ALL")#', '#REGION#')">
If any knows of a better way, I am open to suggestions.
Mario
-----Original Message-----
From: Mosh Teitelbaum [mailto:mosh.teitelbaum@;evoch.com]
Sent: Thursday, November 07, 2002 10:30 AM
To: CF-Talk
Subject: RE: Javascript across windows
When you use JavaScript to open another window, the created window has an
"opener" variable that contains a reference back to the parent window. SO
you can access form variables or functions like:
opener.document.FormName.FieldName.value
opener.doFoo()
--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 625-9191
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/
> -----Original Message-----
> From: Ben Doom [mailto:bdoom@;moonbow.com]
> Sent: Thursday, November 07, 2002 10:11 AM
> To: CF-Talk
> Subject: OT: Javascript across windows
>
>
> Does anyone know how to pass information between browser windows using
> Javascript (or anything else for that matter).
>
> Specifically, I'm using javascript to open a second browser window for a
> user to fill out a small form which needs to return the results to the
> creating browser window. The second browser window needs (unless someone
> has a better idea) to either be able to trigger a function or access form
> elements in the DOM to write the information.
>
> I'd happily post code if people want to see it, but since it
> doesn't seem to
> work at all, I didn't think it necessary. :-)
>
> All help is appreciated.
>
>
>
> --Ben Doom
> Programmer & General Lackey
> Moonbow Software
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com