form表单中的action属性的值是表单提交给的url,如果我们没有设置action属性,那么默认的表单还是提交给当前页面

<form action = "register" method = "post">
    之间是你的显示要提交的表单
</form>
最后的   </form>别忘记,否则点击提交没有反应!!!!!
错误格式:

<form action = "register" method = "post">
</form>
    之间是你的显示要提交的表单

这样的话,只是单纯的显示了表单,是没有提交表单这个action的,这段就不存在了,所以没有反应

<!DOCTYPE html>
<html>
    <head>
    <meta charset="UTF-8">
    <title>注册页面</title>
</head>
<body>
    <form action = "register" method = "post">
        用户名:<input type = "text"  name = "username"><br>
        密码:<input type = "password"  name = "password"><br>
        爱好 : LOL<input type="checkbox" name="hobits" value="lol"> 
        DOTA<input type="checkbox" name="hobits" value="dota"> <br>
        <input type="submit" value="注册">
    </form>
</body>
</html>

```java
<form action = "register" method = "post">

        。。。。。。

</form>

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐