<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>用户注册页面</title>
<style type="text/css">
strong{color: red;font-style: bolder;}
fieldset{width: 560px ;height:186px;padding:0px 50px;}
#button{margin: 10px 20px;}
</style>
<script type="text/javascript">
function $(id){return document.getElementById(id);}
function checkReg(){
var username=$("myname").value;
var pwd=$("mypwd1").value;
var pwdConfirm=$("mypwd2").value;
var checkright=true;
if(username==""||pwd==""){
alert("请确认用户名和密码输入是否正确!!")
checkright=flase;
}else{
if(username.length<6){
alert("用户名长度太短,至少6个字符!!!")
checkright=flase;
}
else if(pwd.length<6){
alert("密码长度太短,至少6个字符!!!")
checkright=flase;
}else if(pwd!=pwdConfirm){
alert("两次输入的密码必须一致!!!")
checkright=flase;
}else{
checkright=true;
}
return checkright;
}
}
function clearInfo(){
var flag=confirm("确认要重置数据吗?");
if(flag==ture){
$("myname").value="";
$("mypwd1").value="";
$("mypwd2").value="";
}
}
</script>
</head>
<body>
<form id="registForm" action="demo2.html" method="get" onsubmit="return checkReg()" onreset="return clearInfo()">
<fieldset>
<legend align="center">新用户注册</legend><br/>
<div>
<laber>用 户 名:</laber>
<input type="text" name="myname"><strong>(用户名要大于6位)</strong><br />
<laber>登录密码:</laber>
<input type="password" name="mypwd1"><strong>(密码要大于6位)</strong><br />
<laber>密码确认:</laber>
<input type="password" name="mypwd2"><br>
<input id="buttom" type="submit" value="用户注册" >
<input type="reset" value="重置">
</div>
</fieldset>
</form>
</body>
</html>
HTML的表单form,为什么我添加了action就显示不出我的提交条件提示框了?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
关注 【相关推荐】
- 这篇文章:html form标签的action属性是什么意思?又有哪些用法?(附实例 也许能够解决你的问题,你可以看下
- 除此之外, 这篇博客: HTML之⑧表单域标签(form)的使用总结中的 action属性的使用 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
回看表单结构
如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^解决 无用评论 打赏 举报
悬赏问题
- ¥15 BP神经网络控制倒立摆
- ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
- ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
- ¥30 Unity接入微信SDK 无法开启摄像头
- ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
- ¥20 cad图纸,chx-3六轴码垛机器人
- ¥15 移动摄像头专网需要解vlan
- ¥20 access多表提取相同字段数据并合并
- ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
- ¥20 Java-Oj-桌布的计算