|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I have a shopping cart that posts to a CGI form that calls authorize.net.
All I am trying to do is send the total amount of the order to authorize.net. The javascript totals the order and displays it on a review form. I can not figure out how to assign that total to an x_amount hidden field. Here is the code that calculates the total: document.write('<table width=400 ><tr><tr><td align=right colspan=3 BGCOLOR=#FF9999><font size=+2>Running Total : $ </td><td colspan=3 BGCOLOR=FF9999> <input type=text name=total size=6 value='+ format(parent.all_order_totals(),2) + '></font></td><tr>'); Any help would be appreciated. Thanks! Mel |
|
#2
|
||||
|
||||
|
This should definately not be done using JS. What about users with JS turned off? Anything that is crucial to the functionality of the site should be done server side.
|
|
#3
|
||||
|
||||
|
To elaborate a bit on what stumpy said and to provide an example, I could download your cart page, change all field values to zero or a very small value, submit the form from my local modified version of the page, and get a bunch of merchandise for a very low price. You always need to have your submitted fields be references to product ids and then, as stumpy said, check the pricing for all ordered items server side before sending to authorize.net.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Javascript Newbie - Need help with one line of code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|