Mike If "document.EmailTemplates.returnto" is a form field, hidden or text, then you need to add .value to the end of it
otherwise, where is "document.EmailTemplates.returnto" coming from? Steve -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Mike Kear Sent: Thursday, September 23, 2004 12:36 PM To: CFAussie Mailing List Subject: [cfaussie] Passing CF variable to javascript As someone who never learned a lot about javascript (and found there was little i wanted to do that i couldnt do with ColdFusion tags) I'm now forced to do a little function in javascript, and i cant do what i normally do - pinch a working bit of code from somewhere else and modify that. What i need is the javascript equivalent of this: (#returnto# is a variable to return the user to one of several locations depending on the context) <cfif returnto IS "library"> <cflocation url="library.cfm"> <cfelseif returnto IS "campaign"> <cflocation url="campaign.cfm"> <cfelse> <cflocation url="index.cfm"> </cfif> Here's what i have so far, and if anyone can make it so that it works, I'll be most grateful!!: function EmailEdit(emailID) { var returnto = ""; document.EmailTemplates.target = ""; if(document.EmailTemplates.returnto == "library"){ document.EmailTemplates.action = "EmailEdit.cfm?returnto="+document.EmailTemplates.returnto+"&emailId="+email ID; } else { document.EmailTemplates.action = "EmailEdit.cfm?emailId="+emailID; } document.EmailTemplates.submit(); } Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com .com,.net,.org domains from AUD$20/Year --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
