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!

Number in form variables? 1

Status
Not open for further replies.

Ayac

Programmer
Nov 10, 2000
141
HU
Hi!

I just wondering if it is possible in Cold Fusion to read a form variable that starts with a number?
With active server pages I can do this:

<% Carry=Request("000_SPONSOR") %>

But can I do the same thing somehow in CF?

<CFSET Carry=URL."000_SPONSOR")??

This does not work...
 
No, its not..

I even tried setting a variable called 1var and it really just doesn't work..

I tried <Cfset 1var=1> and <cfset form.1var=1> I didn't think it would work but it was worth a shot..

Why, are you getting data from somewhere with vars in this format?

Tony

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I'm not sure if I understand what you mean. Are you trying to create a variable named "Carry" with a static value of "Url.000_SPONSOR"? If so, try this:
Code:
<CFSET Carry="URL.000_SPONSOR">
If you're trying to create the variable "Carry" with the dynamic output of the "Url.000_SPONSOR" value, try this:
Code:
<CFSET Carry="#URL.000_SPONSOR#">
If neither one of these are correct, please explain what you're trying to do.



Hope This Helps!

Ecobb

&quot;My work is a game, a very serious game.&quot; - M.C. Escher
 
Thanks for both of you looking at my issue. Well, the reason I use this kind of a weird numbering is that we have a ton of forms with various variables in them and when somebody submits them, they all go to one common script for processing and the variable values coming from a variety of sources all has to be listed in a predefined order (other then alpabetized) so we can save them in the email or text file, where they are to be written. If we number the variables this way, they are always in the right order, we just need to go after the variable names and use the number part for that. I know I probably should have put the number after, so that way I can just cut it off at the end, but ASP did not have a problem with that and now we are converting this common script to ColdFusion and I wanted to find a simple solution, other than go to every form we have and redo the variable names.
 
Is a site-wide search and replace possible... something like replace...

="1 with ="f1
="2 with ="f2
="3 with ="f3
...
="9 with ="f9

You're order will still be preserved because it all starts with the same letter...

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
oops prefix those =" with name so its name="1, name="f1, name="2... etc

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Hmmmm... I never thought about that! It is simple but works! Thank you! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top