Jump to content

Append data to text field on submit


DjMikeWatt

Recommended Posts

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

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.