在页面加载时自动提交表单 [英] Auto submit form on page load

查看:93
本文介绍了在页面加载时自动提交表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的当前问题有点麻烦.任何帮助将不胜感激.

I'm having a bit of trouble with my current issue. Any help would be greatly appreciated.

我已经走了一个不再需要的注册过程",但是我没有时间重新配置整个过程,因此我试图在页面加载时自动提交表单,因此基本上跳过这一步.有什么想法吗?

I have a step in a 'signup process' which I don't need anymore, but I don't have time to reconfigure the entire process so I'm trying to auto submit the form on page load so it will basically skip over this step. Any thoughts?

对不起,我应该提到,最初有两个提交选项,我摆脱了一个,现在我只想在页面加载时提交'mem_type'选项.不知道这是否有很大的区别.

Sorry, I should mention, originally there were two submit options, I got rid of one, now I just want to submit the 'mem_type' option on page load. not sure if that makes much of a difference.

<form method=post action="<?=$base_href.url("signup")?>" name="member_signup">
<input type=hidden name="process" value="facility_info">
<input type=hidden name="create_order" value="true">

<?php
    foreach ($_POST as $k=>$d) {
        if ($k === 'textarea') continue;
        echo "<input type=hidden name=\"".strip_tags($k)."\" value=\"".strip_tags($d)."\">";
    }
?>

<input type="submit" value="submit" name="mem_type" border="0">
</form>

推荐答案

尝试一下 在窗口加载时,提交您的表单.

Try this On window load submit your form.

window.onload = function(){
  document.forms['member_signup'].submit();
}

这篇关于在页面加载时自动提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆