From: Sara Golemon (saramg_at_uclink.berkeley.edu)
Date: Wed Nov 20 2002 - 09:31:02 PST
I'm assuming that #id#, #case_number#, and #img_id# are all numbers. If so
you're fine, otherwise I'd consider a url encode wrapper around them.
<CFOUTPUT>
<SCRIPT LANGUAGE="Javascript">
<!--
function EDIT_IT(id,case_number,img_id) {
window.open('./image_edit.cfm?id='+id+'&case_number='+case_number+'&img_id='
+img_id,,'EANITHING','toolbar=no,location=no,directories=no,status=yes,menub
ar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=600,height=650');
}
// -->
</SCRIPT>
</CFOUTPUT>
.
.
.
.
<CFOUTPUT QUERY="Getmages">
<TD><a href="javascript:EDIT_IT('#id#','#case_number#','#img_id#')">
<img src="images/images/#Getmages.img_name#" alt="" border="0"
height="100" width="100">
</a></td>
.
.
.
</CFOUTPUT>
P.S. - This seems more like a WebNet topic to me.
-----Original Message-----
From: owner-micronet-list_at_uclink4.berkeley.edu
[mailto:owner-micronet-list_at_uclink4.berkeley.edu]On Behalf Of David JL
Rieger
Sent: Tuesday, November 19, 2002 2:37 PM
To: micronet-list_at_uclink4.berkeley.edu
Subject: [Micronet] Coldfusion & Javascript
Hello folks,
If there are some Coldfusion / Javascript people out there this is an
interesting problem. I'm working on an application that takes images and
displays them in a page. I want to click on an image and use Javascript to
have a pop-up window so the user can edit that particular image. I have
this working when one image is returned by a query. When there are a
multitude of records, however, I can either seed the img_id with the first
#img_id# or the last one from the queried set.
The first scenario has a plain CFOUTPUT in the header of the web-page:
<<CFOUTPUT>
<script language="JavaScript">
function EDIT_IT() {
window.open('./image_edit.cfm?id=#id#&case_number=#case_number#&img_id=#GetI
mages.img_id#&case=case&edit=edit','EANITHING','toolbar=no,location=no,direc
tories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,
width=600,height=650');
}
//-->
</script>
</cfoutput>
LATER IN THE PAGE:
<CFOUTPUT QUERY="Getmages">
<TD><a href="javascript:EDIT_IT()">
<img src="images/images/#Getmages.img_name#" alt="" border="0"
height="100" width="100">
</a></td>
#########################################################3
The second in the Jscript part of the page reads <CFOUTPUT
QUERY="GetImages">, in this case I get the last img_id of the set. So what
ever image I click on that is returned in the initial query either has the
first img_id or the last depending on how I set up the CFOUTPUT in the
JavaScript portion of the page.
Is there a way to dynamically populate the range of img_id's
(img_id=#img_id#) in the EDIT_IT() function?
Thanks!
David Rieger
------------------------------------------------------------------------
The following was automatically added to this message by the list server:
For information about Micronet, including subscribing to
or unsubscribing from its mailing list and finding out
about upcoming meetings, please visit the Micronet Web site:
<http://micronet.berkeley.edu/>.
------------------------------------------------------------------------
The following was automatically added to this message by the list server:
For information about Micronet, including subscribing to
or unsubscribing from its mailing list and finding out
about upcoming meetings, please visit the Micronet Web site:
<http://micronet.berkeley.edu/>.
This archive was generated by hypermail 2.1.5 : Wed Nov 20 2002 - 09:32:11 PST