<cfset form.myvariable = url.myvariable>

I would suggest encoding/decoding all your url variables though. Nice
UDF at udflib.org to handle this.

Cutter

Andrew Grosset wrote:
> Thanks for answering my question.
>    The following is related but more of a _javascript_ problem than cold
> fusion: I want to pass a variable in the form of a url but have it
> processed as a form.variable in the action page rather than pass it
> through the url. The following will process the url but I cannot figure
> out how to transfer the variable: "myvariable" to a form field that can
> be processed on the action page as a form field.
>
> I am trying to do this so that no variables need to be passed in the url
> and all variables are sent as form fields. I know I could use a hidden
> form field to pass "myvariable" but I'm sure my _javascript_ can be made
> to work!!
>
> <html>
> <head>
> <script language=_javascript_>
> function SubmitForm(page,myvariable)
> {
> //Get the action statement and submit the form
>     //next line currently causes the form not to submit
>     //document.myTest.form.km.var=myvariable
> document.myTest.target = "_self";
> document.myTest.action = ""> > document.myTest.submit();
> }
> </script>
>
> <title>Untitled</title>
> </head>
>
> <body>
> <cfif IsDefined("form.km")>
> <p>Yes, <cfoutput>km=#km#</cfoutput>
> <cfelse>
> <p>No.
> </cfif>
> <form name=myTest method=post>
> <p><a href=''>test</a>
>
> </form>
>
> </body>
> </html>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to