在 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>
互换的青春
相关分类