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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Variables from a javascript page to a CF page

Status
Not open for further replies.

ma701sd

IS-IT--Management
Dec 15, 2000
94
GB
Hi, Can any1 help...

I am passing many variables between pages but what I need to do now is to pass some variables as well as client variables from a form to an action page. The first page contains some javascript.
Basically the javascript captures an X and Y co-ordinate within a form. The X and Y co-ordinate is passed however I want to be able to position a hidden variable that I am also passing within the same form on the action page however for some reason all that is positioned is the variable enclosed within "#Var#" and not the Value itself.
I confirmed this by also trying to pass the CFID and CFTOKEN vars but these are not passed either.

DOes anyone have any examples that I might be able to have a look at?

Many thanks

Sam
 
&quot;for some reason all that is positioned is the variable enclosed within &quot;#Var#&quot; and not the Value itself. &quot; --> don't forget the <cfoutput>s !!!!
if your form lookslike this there should be no problem passing variables to page2.htm :
<form action=&quot;page2.htm&quot; ...>
<input type=.... name=&quot;x&quot; value=...>
<input type=.... name=&quot;y&quot; value=...>
<input type=hidden name=... value=<cfoutput>&quot;#var#&quot;</cfoutput>>
</form>
 
Hey Sam,

I'm a little confused by this part

&quot;all that is positioned is the variable enclosed within &quot;#Var#&quot; and not the Value itself. &quot;

Are you trying to output the value of the variable or use it as an attribute such as <div style=&quot;position: absolute; top: #var#px; ...>? I'm not sure what you mean by positioning the variable. As iza says, it almost sounds like you just need cfoutput tags but I'm guessing that would be too simple a solution :)

GJ
 
Hey People, sorry for wasting your time with a stupid thread like this.

It was something very very silly, I forgot to use CFOUTPUT!!!! ( But I was kinda thinking it might be more than that)..I know, I deserve a slap on the wrist!

Sorry once again for wasting time :)

Sam...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top