pmjm1 Posted September 24, 2009 Share Posted September 24, 2009 Hi, I need to submit a form to an external site (credit card processor), but which first multiplies a single field by 100 (cents to dollars) when it is submitted. Is this possible without putting an intermediate step in? thanks Link to comment https://forums.phpfreaks.com/topic/175365-multiply-a-value-on-submit/ Share on other sites More sharing options...
Bricktop Posted September 24, 2009 Share Posted September 24, 2009 Hi pmjm1, Please post your code so we can take a look and give a more definite answer. Thanks Link to comment https://forums.phpfreaks.com/topic/175365-multiply-a-value-on-submit/#findComment-924122 Share on other sites More sharing options...
pmjm1 Posted September 24, 2009 Author Share Posted September 24, 2009 I don't have any php yet, just the html form, see below. The field I need to multiply by 100 is the 'eWayTotalAmount', or just add 00 to the value when it is submitted. So far I can't find a solution without having an additional page. <form method="post" action="https://www.eway.com.au/gateway/payment.asp"> <table> <tr><td><p>Your last name:</p></td><td> <input type="text" name="ewayCustomerLastName"/></td></tr> <tr><td><p>Your first name:</p></td><td> <input type="text" name="ewayCustomerFirstName"/></td></tr> <tr><td><p>Your email address:</p></td><td> <input type="email" name="ewayCustomerEmail" /></td></tr> <tr><td><p>Donation amount:</td><td> AUD$ <input type="text" name="ewayTotalAmount" size="7"></p></td></tr></table> <input type="hidden" name="ewayCustomerID" value="13xxx563" /> <input type="hidden" name="ewayURL" value="http://www.nnn.com.au/register.php" /> <br /> <input type="image" name="submit" src="images/donate-off.png" alt="Join Now" width="191" height="69" border="0" id="Image2" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','images/donate-on.png',1)"> </form> Link to comment https://forums.phpfreaks.com/topic/175365-multiply-a-value-on-submit/#findComment-924158 Share on other sites More sharing options...
Bricktop Posted September 24, 2009 Share Posted September 24, 2009 Hi pmjm1, I think you're going to have to use a Javascript solution to do this. Unless your payment gateway provides a PHP API or allows cURL submissions. Someone else may have a better solution for this but I think they're your only options. Link to comment https://forums.phpfreaks.com/topic/175365-multiply-a-value-on-submit/#findComment-924167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.