Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use Javascript with Application.cfm

Status
Not open for further replies.

tracyprs

Programmer
Apr 10, 2001
1
US
Hello gurus!

I need some help changing Application.cfm variables with Javascript. I have a <cfparam> variable called application.myvar that I would like to have <cfset> using my javascript.js page. I am calling the javascript function from the first page with an <a href=javascript:myfunction(arg)> and would like the javascript function to perform the cfset as follows...

function myfunction(arg){
<cfset #application.myvar#=arg;>
}

Can this be done? and How?

Thanks for any help...
tracyprs
 
hi tracyprs

Im not exactly sure what you're trying to do with your application variables, maybe you could explain your goal a little more here and we could offer a solution.

As far as using javascript to create variables, thats just not something that can be done &quot;client side&quot; . All CF tags are interpreted, and then deleted from the final HTML page that is sent to a client's browser. So, no im afraid your function:

function myfunction(arg){
<cfset #application.myvar#=arg;>
}

would just appear like this if you were to view source on the browser:

function myfunction(arg){

}

I suppose I see what you're just trying to create dynamic variables, and if you can explain the goal here we can probably work it out.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top