DjMikeWatt Posted August 5, 2008 Share Posted August 5, 2008 Hello, all... This is a great forum! I have a question about using php to append a form after it's submitted. Basically, with AMAZON PAYMENTS the "amount" field must be submitted in the format "USD XXX.XX" What I want to do is allow the user to input the amount, and then have the server add the "USD " invisibly... Right now I just have it sitting in there along with the user's current balance due: <input name="amount" type="text" id="amount" value="<?php echo 'USD '.$row_user_id_data['act_balance']; ?>" /> So, is there a simple way to do what I want to do? It seems like it can't be all that difficult, I'm just not seeing the answer. Any help is appreciated!! Thanks. Link to comment https://forums.phpfreaks.com/topic/118204-append-data-to-text-field-on-submit/ Share on other sites More sharing options...
trq Posted August 5, 2008 Share Posted August 5, 2008 Append it on the recieving end. eg; $amount = 'USD ' . $_POST['amount']; Link to comment https://forums.phpfreaks.com/topic/118204-append-data-to-text-field-on-submit/#findComment-608300 Share on other sites More sharing options...
DjMikeWatt Posted August 5, 2008 Author Share Posted August 5, 2008 Well, I can't do that because it submits directly to Amazon. Which is why the submission has to be in that format to begin with. Hey, idea... Since Amazon is looking for the $_POST variable called "amount", could I create a hidden field called "amount" and change the input field to something else ("txt-amount"), then somehow set the hidden field to 'USD '.['txt-amount'] (without bouncing the page off another php server first?) Anyone have any idea about that? Link to comment https://forums.phpfreaks.com/topic/118204-append-data-to-text-field-on-submit/#findComment-608970 Share on other sites More sharing options...
DarkWater Posted August 5, 2008 Share Posted August 5, 2008 I'd submit it to your page, handle all the input, then send it off to the Amazon page with cURL. Link to comment https://forums.phpfreaks.com/topic/118204-append-data-to-text-field-on-submit/#findComment-608983 Share on other sites More sharing options...
DjMikeWatt Posted August 5, 2008 Author Share Posted August 5, 2008 Yeah, I guess that's really the only way... Thanks, man... Link to comment https://forums.phpfreaks.com/topic/118204-append-data-to-text-field-on-submit/#findComment-608991 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.