Skip to main content
Participant
November 18, 2007
Question

Session Variable - Setting as Value on Form

  • November 18, 2007
  • 1 reply
  • 264 views
Hi, All,

First post! I'm having an issue calling a session variable as a value in one of my textboxes. Here are the relevant chunks of my code (this is on my action page, which is being generated from another form page, in which the variable "test" gets its value from):

<cfset session.test2=form.test>

<input name="test3" value="#session.test2#">
//This part won't work. The session.test2 value can't be called as the initial value of a textbox for some reason. The textbox's value will be shown as the text "#session.test2#" instead of the value stored in session.test2
This topic has been closed for replies.

1 reply

Inspiring
November 18, 2007
You just need to put <cfoutput> tags around. Then CF will evaluate the variable and return its value instead of the text "#session.test2#"

<cfoutput>
<input name="test3" value="#session.test2#">
</cfoutput>