在 ReactJS 中加載頁面時如何提交form?<form id="redirectForm" method="post" action="https://test.cashfree.com/billpay/checkout/post/submit"> <input type="text" name="appId" value={this.state.appId}/> <input type="text" name="orderId" value={this.state.orderId}/> <input type="text" name="orderAmount" value={this.state.orderAmount}/> <input type="text" name="orderCurrency" value={this.state.orderCurrency}/> <input type="text" name="orderNote" value={this.state.orderNote} /> <input type="text" name="customerName" value={this.state.customerName}/> <input type="text" name="customerEmail" value={this.state.customerEmail} /> <input type="text" name="customerPhone" value={this.state.customerPhone} /> <input type="text" name="returnUrl" value={this.state.returnUrl} /> <input type="text" name="notifyUrl" value={this.state.notifyUrl} /> <input type="text" name="signature" value={this.state.signature}/> <button type="submit">Pay</button></form>Java腳本:<script>document.getElementById("redirectForm").submit();</script>
如何在 React JS 中形成加載時提交?
子衿沉夜
2023-05-19 18:16:47