i am trying to integrate a transaction form that uses a set amount. for this project, i really need to make the transaction amount flexible - editable by the user. here's the code i need to tweak (i trimmed it down a bit to show the key parts)

i basically would like to make that "x_amount" variable a text input instead of hidden; i need code which would edit the $amount in PHP to match the one the user types into the form input field, then submits the form as normal...

i think this might be possible with an ajax / JS onbeforesubmit hook, but not clear how to code that? or maybe there's a more elegant way?

Why does the amount need to be accessed in PHP? Cant you just post the amount value along with the form?
–
Kieran AndrewsDec 20 '11 at 22:12

I think he wants to keep it saved for the users. So, they can set/update their $amount later.
–
BiotoxDec 20 '11 at 22:15

@Kieran i've tried, but the action URL refuses this submission (when the $amount and x_amount don't match). the $amount needs to change from the pre-set one to match the typed x_amount, right before the form is submitted...
–
dubesorDec 20 '11 at 22:17