Welcome to Dream.In.Code
Click Here
Getting Help is Easy!

Join 117,542 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,670 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Setting Variables Equal

 
Reply to this topicStart new topic

Setting Variables Equal

sysadmin07
post 4 Nov, 2007 - 11:25 AM
Post #1


New D.I.C Head

*
Joined: 4 Nov, 2007
Posts: 2


My Contributions


Hi everyone! First post.

I'm trying to send a user-entered field from a textbox into two ColdFusion variables. For example, if I have <input name="test"> and I want to set "test2" equal to it, how would I go about doing so?

I've tried the following, but to no avail:

-Form page
-Page name is formtest
-<input name="test">

-Action page (separate CF page, btw)
-<cfset test2 = "#formtest.test#">

Thanks.
User is offlineProfile CardPM

Go to the top of the page


wiredwizard
post 9 Nov, 2007 - 03:03 AM
Post #2


D.I.C Head

Group Icon
Joined: 7 May, 2005
Posts: 72



Dream Kudos: 225
My Contributions


your set tag should be

[<cfset test2 = form.test>]

QUOTE(sysadmin07 @ 4 Nov, 2007 - 11:25 AM) *

Hi everyone! First post.

I'm trying to send a user-entered field from a textbox into two ColdFusion variables. For example, if I have <input name="test"> and I want to set "test2" equal to it, how would I go about doing so?

I've tried the following, but to no avail:

-Form page
-Page name is formtest
-<input name="test">

-Action page (separate CF page, btw)
-<cfset test2 = "#formtest.test#">

Thanks.

User is offlineProfile CardPM

Go to the top of the page

sysadmin07
post 16 Nov, 2007 - 07:59 PM
Post #3


New D.I.C Head

*
Joined: 4 Nov, 2007
Posts: 2


My Contributions


Thank you. I ended up using a session variable and setting it equal to that. However, I'm having an issue calling it as a value in one of my textboxes. Here are the relevant chunks of my code on my action page:

<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 post has been edited by sysadmin07: 17 Nov, 2007 - 07:44 PM
User is offlineProfile CardPM

Go to the top of the page

skyhawk133
post 18 Nov, 2007 - 08:30 AM
Post #4


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,600



Thanked 39 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


You need to put a <cfoutput> around the input for it to output the variable in coldfusion.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 05:31PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month