Copy link to clipboard
Copied
Is there a way to change or copy all url variables so they are scoped as form variables with one statement?
For example:
<cfset form.var1 = url.var1>
<cfset form.var2 = url.var2>
<cfset form.var3 = url.var3>
Can this be done with one statement?
Did you try:
<cfset form = url>
OR
<cfset form = duplicate(url)>
I'm not 100% sure you can add to the form scope like that in all versions of CF.
If not, you can work with a thrid variable that you incorperate both form and url variables into. This is a tecnique common in the Fusebox Framework, I believe.
Copy link to clipboard
Copied
Did you try:
<cfset form = url>
OR
<cfset form = duplicate(url)>
I'm not 100% sure you can add to the form scope like that in all versions of CF.
If not, you can work with a thrid variable that you incorperate both form and url variables into. This is a tecnique common in the Fusebox Framework, I believe.
Copy link to clipboard
Copied
I’m using CF 8 - but couldn't get the to work. I used the third variable technique you suggested and it works. Thanks for the help!
Beth