我有一个带动作的表格。在没有 AJAX 的情况下创建重定向到另一个页面的主要问题发送当前页面的数据(在操作中)并重定向到另一个页面。有可能还是PHP?const formElem = document.getElementById('form'); formElem.addEventListener('submit', function(e) { //e.preventDefault(); window.location.replace('https://dhge.org/pay/{{ uuid }}/'); }) <form method="post" action="https://www.tfaforms.com" class="hintsBelow" id="form" role="form"> <div class="jForm__row jForm__row-margin" id="tfa_1-D"> <label id="tfa_1-L" class="jForm__label" for="tfa_1">First Name<span> *</span></label> <div class="jForm__field"> <input type="text" id="tfa_1" name="tfa_1" required value="" title="First Name " data-dataset-allow-free-responses="" class="jForm__input"> </div> </div> </form>
2 回答
![?](http://img1.sycdn.imooc.com/5458463b0001358f02200220-100-100.jpg)
湖上湖
TA贡献2003条经验 获得超2个赞
将数据作为 ajax 发送到以 JSON 格式返回数据的 php 控件,然后处理您重定向到下一页的数据,或者使用表单目标页面上的标头函数通过 php 本身重定向。
添加回答
举报
0/150
提交
取消