are you able to just pass the returnto value into the js function?
something like
<script>
function EmailEdit(formObj, emailID, returnTo) {
if(returnTo.toLowercase() == "library") {
formObj.action = "EmailEdit.cfm?returnto=" + returnTo +
"&emailId=" + emailID;
}
else {
formObj.action = "EmailEdit.cfm?emailId=" + emailID;
}
formObj.submit();
}
</script>
notice i am passing in 3 arguments now
formObj is the form your using. You would do this if your going to be
accessing forms and you have them as different names
emailID is as your using it
returnTo is being passed directly into the function so you might call it
like this
EmailEdit(document.forms["formName"], 21, "library")
and so on
Steve
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Mike Kear
Sent: Thursday, September 23, 2004 12:49 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Passing CF variable to javascript
G'day Steve,
Depending on the context (i'm trying to re-use forms in several
places around the site) it is either a url variable or determined
from http_referer or a form variable. So in the top of the page i
have a <cfswitch to set the variable #returnto#. Then i can have
other parts of the page relevant to the job the user is doing. This
particular bit has to do some javascript work, and if everything
checks out, send him back to where he came from, using the variable
returnto to decide where.
But at the time this piece of javascript is run, the CF variable
returnto has values like "library" or "campaign" or "singleuse"
That help?
Cheers
Mike Kear
Windsor, NSW, Australia
AFP Webworks
http://afpwebworks.com
.com,.net,.org domains from AUD$20/Year
On Thu, 23 Sep 2004 12:44:28 +1000, Steve Onnis <[EMAIL PROTECTED]>
wrote:
> 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
>
---
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/