Click here to Skip to main content
15,890,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi people.
Been doing some updates to my website and got abit stuck.
I have a dropdown where a user selects payment amount "youhave":
HTML
<input type="text" name="youhave" class="form-control" value="1" id="youhave" value="1"


Then later on in the processing phase of my site i have some html buttons for perfectmoney, and advcash,
On these buttons there is a text field where you have to confirm the amount again before you click the appropriate payment button:

HTML
<form target="_blank" action="https://perfectmoney.is/api/step1.asp" 
method="POST">
<input type="hidden" name="PAYEE_ACCOUNT" value="U3492039">
<input type="hidden" name="PAYEE_NAME" value="Cryptonage">
<input type="hidden" name="PAYMENT_ID" value="Cryptonage">
<input type="text"   name="PAYMENT_AMOUNT" value="">               
<input type="hidden" name="PAYMENT_UNITS" value="USD">
<input type="hidden" name="STATUS_URL" 
value="http://127.0.0.1/cryptonage.net">
<input type="hidden" name="PAYMENT_URL" 
value="http://127.0.0.1/cryptonage.net">
<input type="hidden" name="PAYMENT_URL_METHOD" value="GET">
<input type="hidden" name="NOPAYMENT_URL" 
value="http://127.0.0.1/cryptonage.net">
<input type="hidden" name="NOPAYMENT_URL_METHOD" value="GET">
<input type="hidden" name="SUGGESTED_MEMO" value="">
<input type="hidden" name="BAGGAGE_FIELDS" value="">
<input type="submit" name="PAYMENT_METHOD" value="Pay with PerfectMoney">
</form>


how can i link the amount that was entered in "youhave" to the "PAYMENT_AMOUNT" input and hide the text field instead of having to type the amount again in the text field next to the button?

thanks in advance, updated question and provided code.

What I have tried:

changing text input for amount to hidden and setting value to "youhave", not mega experienced just trying to resolve this small issue.
Posted
Updated 19-Apr-18 15:18pm
v10

1 solution

Use below code using jQuery
JavaScript
var enteredValue = $("#youhave").val();

using JavaScript
JavaScript
var enteredValue = document.getElementById("youhave").value;

Hope you have the HTML like this
HTML
<input type="text" name="youhave" id="youhave" value="1250">
 
Share this answer
 
Comments
Member 13707161 19-Apr-18 18:46pm    
Do i enter this in the lines in the second form? can't get it to work, updated question for better understanding and provided code. thanks for your answer!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900