Below is a user_id value that I obtained in the script
<script>
$.ajax({
dataType: "json",
url: "/index.php?ctl=user&act=userdetail",
async: true,
success: function(result) {
var user;
user = result.user
var user_id = user.id
}
})
</script>
I want to send this user_id value in the form below, but I could not find how to add it to the value part. Is there any other way to post this to that page or?
<div class="card shadow">
<ul>
<li class="pack">100 Points</li>
<li id="one" class="price bottom-bar">$79,99</li>
<li class="bottom-bar">100 Points</li>
<form action="test.php" method="post">
<input type="hidden" name="amount" value="$79,99">
<input type="hidden" name="package" value="100 Points">
//Here I want to send the user_id value.
<input type="submit" class="btn" value="Send">
</form>
</ul>
</div>
<div class="card shadow">
<ul>
<li class="pack">200 Points</li>
<li id="one" class="price bottom-bar">$179,99</li>
<li class="bottom-bar">200 Points</li>
<form action="test.php" method="post">
<input type="hidden" name="amount" value="$179,99">
<input type="hidden" name="package" value="200 Points">
//Here I want to send the user_id value.
<input type="submit" class="btn" value="Send">
</form>
</ul>
</div>