drryyiuib43562604 2012-11-27 22:45
浏览 31
已采纳

加载页面时单击按钮

How to make a certain buttom be clicked on the load of the page?

<script src="http://code.jquery.com/jquery-latest.js"></script>

<script>
$("#submit").click(function() {
  $("#submit").click();
});
</script>

</head>

<body>

<form action="Untitled-9.php" method="post">
<input type="text" name="name" value="dsa"/>
<input type="submit" name="submit" value="Register" />
</form>


<?php

$name = $_POST['name'];

echo $name;

?>


</body>

This is the code I have and I want when the page is loaded to press the button "Register" automatically

  • 写回答

5条回答 默认 最新

  • dpp78272 2012-11-27 22:47
    关注
    <?php if ($_POST["name"] == "") { ?>
    
    <script type="text/javascript">
        $(document).ready(function() {
            $("input[name=submit]").click();
        });
    </script>
    
    <?php } else {
    
        echo $_POST["name"];
    
    } ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了