Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Chizzy66 #1
Passing Dynamic Variable In A Hidden Form
Hello:
I am trying to pass a hidden variable from a form on my web application to the
PayPal site for payment processing. I can get my code to work on my development
machine (CF MX 7); however, I am getting the following error message when I try
to run it on the hosting server (CF MX 6).
I have tried to use an html form with <input> tags instead of the <cfinput>
tags; however, I run into a problem when I try to pass a string that has been
dynamically generated (#custom#) in the code example below. Instead of passing
my string, it is literally passing the value of #custom# as the variable.
Here is the code below with non problematic parts removed in the interest of
space:
<!--- Generate A Custom Variable To PASS To PayPal --->
<cfset custom = #CreateUUID()#>
<!--- Create the hidden form to pass PayPal button information --->
<cfform action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<cfinput type="hidden" name="cmd" value="_xclick">
<cfinput type="hidden" name="business" value="businessname@mycompany.com">
<cfinput type="hidden" name="item_name" value="Thing For Sale">
<cfinput type="hidden" name="item_number" value="1">
<cfinput type="hidden" name="amount" value="10.00">
<cfinput type="hidden" name="no_shipping" value="2">
<cfinput type="hidden" name="no_note" value="1">
<cfinput type="hidden" name="currency_code" value="CAD">
<cfinput type="hidden" name="lc" value="CA">
<cfinput type="hidden" name="custom" value="#custom#">
<cfinput type="image"
src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif" border="0"
name="submit_single" alt="Click here to process your credit card payment via a
secure web site.">
<cfinput type="submit" name="Submit" value="Process My Credit Card Payment">
</cfform>
Thank you for any advice that you can offer me with this problem. Moving the
site to a CF7 server at this time is not an option for me.
Regards,
Paul Chisholm
Cornwall, Ontario, Canada
Chizzy66 Guest
-
Problem passing hidden fields using Flash form
I'm working with Flash forms for the first time, and am having problems passing information in hidden fields. The information was passed from prior... -
form variable passing
I am struggling with this what i want to do is submit the form in a center pop up window. The submit button is a hyperlink not a button. here is... -
Passing A Form Variable
:confused; Hello all, I'm trying tu modify information that is changed by the client. I'm using the master id number in the WHERE clause of the... -
Passing form entry to URL variable
Hi, I'm on to my user administration section, and I want there to be a page where administrator enters a 'buildnumber' into a form, clicks search... -
Passing form variable
Hello, I've got a hidden field that is passed using the GET method to the next page. The field has a string value (assigned by a variable) with... -
Laksma #2
Re: Passing Dynamic Variable In A Hidden Form
Hi Paul,
In CF6, CFINPUT only support the following types:
RADIO,CHECKBOX,PASSWORD,TEXT. Use HTML INPUT tag. You may leave the CFFORM.
Laksma
<!--- Generate A Custom Variable To PASS To PayPal --->
<cfset custom = #CreateUUID()#>
<!--- Create the hidden form to pass PayPal button information --->
<cfform action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="businessname@mycompany.com">
<input type="hidden" name="item_name" value="Thing For Sale">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="lc" value="CA">
<input type="hidden" name="custom" value="#custom#">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif"
border="0" name="submit_single" alt="Click here to process your credit card
payment via a secure web site.">
<input type="submit" name="Submit" value="Process My Credit Card Payment">
</cfform>
Laksma Guest
-
Chizzy66 #3
Re: Passing Dynamic Variable In A Hidden Form
Hello Laksma:
Thank you for the fast response. I have tried using the HTML <input> tag as
follows:
<input type="hidden" name="custom" value="#custom#">
<cfinput type="hidden" name="custom" value="<cfoutput>#custom#</cfoutput>">
However, both of those statements pass the string as #custom# instead of the
string that I assigned to the variable called custom using the following
statement:
<cfset custom = #CreateUUID()#>
The statement above creates a string in the form of:
976B81AD-B0D0-6834-297A02473995683F
That I need to pass to PayPal. Thanks again for any advice or assistance that
you can provide.
Paul
Chizzy66 Guest
-
The ScareCrow #4
Re: Passing Dynamic Variable In A Hidden Form
Try
<cfoutput>
<input type="hidden" name="custom" value="#custom#">
</cfoutput>
Ken
The ScareCrow Guest
-
Laksma #5
Re: Passing Dynamic Variable In A Hidden Form
I tried the code using CFMX6.1 and it works fine. Also try what Ken suggested. Put CFOUTPUT.
Laksma
Laksma Guest
-
Chizzy66 #6
Re: Passing Dynamic Variable In A Hidden Form
Hello Ken:
Thank you very much, your suggestion worked perfectly! Have a wonderful day.
Paul
Chizzy66 Guest
-
alvin #7
Re: Passing Dynamic Variable In A Hidden Form
Thanks to all. I encountered this problem and found this solution through google.
alvin Guest



Reply With Quote

