我正在尝试在bigchaindb testnet中发送表单值。在javascript中成功访问了表单值,但无法在资产值中发送该变量值。
<body>
<form id="form">
<input type="text" name="inp">
<button onclick="send()" type="button">click</button>
</form>
<p>Your transaction id is: <a id="mydata" target="_blank"><em>processing</em></a></p>
<script>
const API_PATH = 'https://test.bigchaindb.com/api/v1/'
var form=new FormData(document.getElementById("form"));
var inputvalue=form.get('inp');
function send(){
const alice = new BigchainDB.Ed25519Keypair()
// Construct a transaction payload
const tx = BigchainDB.Transaction.makeCreateTransaction(
// users data,entered in forms
{ name: inputvalue },
// Metadata
{ what: 'My data in BigchainDB transaction' },