Coldfusion & Javascript

Date view Thread view Subject view Author view Attachment view

From: David JL Rieger (drieger_at_olac.berkeley.edu)
Date: Tue Nov 19 2002 - 14:36:32 PST


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=#GetImages.img_id#&case=case&edit=edit','EANITHING','toolbar=no,location=no,directories=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/>.


Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.5 : Tue Nov 19 2002 - 14:49:05 PST