I want to make a Store using PayPal. I want the user to give their In-Game Username in a text-field, after that I want the value of the input named “ign” to be the same as the given value by the user. Why I want it like this and not a text field in the form, is because I want the user to only fill in his Username once and still be able to buy more than only one item and I don’t want 30 text fields that all ask for the same thing. This is what I have now and I know it is not working but I’m searching for somebody who can say which Javascript I need to use or HTML. Don’t mind the Capital words in the form. I have them right in my own website.
<script>$("input.txtPlayerName").val($("#PlayerName").val());</script>
<input id="PlayerName" type="text" placeholder="Player Name" >
<form method="POST" action="http://YOUR-STORE-URL-HERE/cart/directpay">
<input type="hidden" name="gateway" value="GATEWAY-NAME-HERE" />
<input type="hidden" name="package" value="PACKAGE-ID-HERE" />
<input type="hidden" class="txtPlayerName" name="ign" value="" />
<input type="submit" value="Purchase" />
</form>
Thanks for reading and maybe answering.
You could set it in the change event: