- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
<html>
<head>
<title>Register</title>
<style>
.content{
position: relative;
top: 130px;
border:3px solid black;
padding: 50px;
width:300px;
margin: auto auto 200px auto;
align: center;
}
body{
background-image: url(Register.jpg);
background-size: cover;
}
.s1{
float:left;
}
.s2{
float:right;
}
.s3 {
margin-left: 110px;
}
.s4{
margin-left: 90px;
}
.s4 a{
color: black;
font-size: 12;
}
.s4 a:hover{
color: blue;
}
p{
font-size: 12;
color: red;
}
.d1{
margin-left:
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
$("#pass , #pass1").on("keyup", function () {
if ($("#pass").val() == $("#pass").val()) {
$("#pass1").css("border", "3px solid green");
} else
$("#pass1").css("border", "3px solid red");
});
</script>
</head>
<body>
<jsp:include page="header.html"/>
<div class="container">
<div class="content">
<form class="page" method="post" action="RegisterPage" name="register">
<span class="s1">
First Name
</span>
<span class="s2">
<input name="firstname" placeholder="Firstname" id="firstname" required>
</span>
<br><br>
<span class="s1">
Last Name
</span>
<span class="s2">
<input name="lastname" placeholder="Lastname" id="lastname" required>
</span>
<br><br>
<span class="s1">
Date of Birth
</span>
<span class="s2">
<input id = "input1" name="dob" type="date" placeholder="DD-MM-YYYY" id="date" required>
</span>
<br><br>
<span class="s1">
Gender
</span>
<span class="s2">
<input id = "input2" type="radio" name="gen" value="Male" required>Male
<input id = "input2" type="radio" name="gen" value="Female">Female
</span>
<br><br>
<span class="s1">
Membership Type
</span>
<span class="s2">
<input id = "input2" type="radio" name="mem" value="Librarian" required>Librarian
<input id = "input2" type="radio" name="mem" value="Member">Member
</span>
<br><br>
<span class="s1">
Address
</span>
<span class="s2">
<input name="addr" placeholder="Address First Line" id="addr" required>
</span>
<br><br>
<span class="s1">
Contact Number
</span>
<span class="s2">
<input id = "input1" name="c_no" type="number" placeholder="9999888777" id="c_no" required>
</span>
<br><br>
<span class="s1">
Email ID
</span>
<span class="s2">
<input name="loginID" type="email" placeholder="abc@def.com" id="loginID" required>
</span>
<br><br>
<span class="s1">
Username
</span>
<span class="s2">
<input name="username" placeholder="Username" id="username" required>
</span>
<br><br>
<span class="s1">
Password
</span>
<span class="s2">
<input name="password" type = "password" placeholder="Password" id="pass" required>
</span>
<br><br>
<span class="s1">
Confirm Password
</span>
<span class="s2">
<input name="password1" type="password" placeholder="Confirm Password" id="pass1" required>
</span>
<br>
<div class="d1"><p>${error}</p></div>
<br><br>
<span class="s3"><input type="submit" value="Register" onClick="check()"></span>
<br><br>
<span class="s4">
<a href="Login.jsp">Already a user!! Login</a>
</span>
</form>
</div>
</div>
<jsp:include page="footer.html"/>
</body>
</html>
代码无法正常工作。当两个密码相等时应该显示GREEN 边框,当密码不相等时显示RED 边框。但它不起作用。我正在使用 Eclipse IDE。提前致谢!!
我试过更改 ID,但没有用。使用不同的名称和 ID 会影响 jquery 语句吗?
最佳答案
你的错误:
if ($("#pass").val() == $("#pass").val()) {
^---------------------
更改为:
if ($("#pass").val() == $("#pass1").val()) {
^---------------------
$(document).ready(function(){
$("#pass , #pass1").on("keyup", function () {
if ($("#pass").val() == $("#pass1").val()) {
$("#pass1").css("border", "3px solid green");
}
else
$("#pass1").css("border", "3px solid red");
});
})
.content{
position: relative;
top: 130px;
border:3px solid black;
padding: 50px;
width:300px;
margin: auto auto 200px auto;
align: center;
}
body{
background-image: url(Register.jpg);
background-size: cover;
}
.s1{
float:left;
}
.s2{
float:right;
}
.s3 {
margin-left: 110px;
}
.s4{
margin-left: 90px;
}
.s4 a{
color: black;
font-size: 12;
}
.s4 a:hover{
color: blue;
}
p{
font-size: 12;
color: red;
}
.d1{
margin-left:
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<jsp:include page="header.html"/>
<div class="container">
<div class="content">
<form class="page" method="post" action="RegisterPage" name="register">
<span class="s1">
First Name
</span>
<span class="s2">
<input name="firstname" placeholder="Firstname" id="firstname" required>
</span>
<br><br>
<span class="s1">
Last Name
</span>
<span class="s2">
<input name="lastname" placeholder="Lastname" id="lastname" required>
</span>
<br><br>
<span class="s1">
Date of Birth
</span>
<span class="s2">
<input id = "input1" name="dob" type="date" placeholder="DD-MM-YYYY" id="date" required>
</span>
<br><br>
<span class="s1">
Gender
</span>
<span class="s2">
<input id = "input2" type="radio" name="gen" value="Male" required>Male
<input id = "input2" type="radio" name="gen" value="Female">Female
</span>
<br><br>
<span class="s1">
Membership Type
</span>
<span class="s2">
<input id = "input2" type="radio" name="mem" value="Librarian" required>Librarian
<input id = "input2" type="radio" name="mem" value="Member">Member
</span>
<br><br>
<span class="s1">
Address
</span>
<span class="s2">
<input name="addr" placeholder="Address First Line" id="addr" required>
</span>
<br><br>
<span class="s1">
Contact Number
</span>
<span class="s2">
<input id = "input1" name="c_no" type="number" placeholder="9999888777" id="c_no" required>
</span>
<br><br>
<span class="s1">
Email ID
</span>
<span class="s2">
<input name="loginID" type="email" placeholder="abc@def.com" id="loginID" required>
</span>
<br><br>
<span class="s1">
Username
</span>
<span class="s2">
<input name="username" placeholder="Username" id="username" required>
</span>
<br><br>
<span class="s1">
Password
</span>
<span class="s2">
<input name="password" type = "password" placeholder="Password" id="pass" required>
</span>
<br><br>
<span class="s1">
Confirm Password
</span>
<span class="s2">
<input name="password1" type="password" placeholder="Confirm Password" id="pass1" required>
</span>
<br>
<div class="d1"><p>${error}</p></div>
<br><br>
<span class="s3"><input type="submit" value="Register" onClick="check()"></span>
<br><br>
<span class="s4">
<a href="Login.jsp">Already a user!! Login</a>
</span>
</form>
</div>
</div>
你也可以使用input
事件,像这样:
$(document).ready(function(){
$("#pass , #pass1").on("input", function () {
if ($("#pass").val() == $("#pass1").val()) {
$("#pass1").css("border", "3px solid green");
}
else
$("#pass1").css("border", "3px solid red");
});
})
$(document).ready(function(){
$("#pass , #pass1").on("input", function () {
if ($("#pass").val() == $("#pass1").val()) {
$("#pass1").css("border", "3px solid green");
}
else
$("#pass1").css("border", "3px solid red");
});
})
.content {
position: relative;
top: 130px;
border:3px solid black;
padding: 50px;
width:300px;
margin: auto auto 200px auto;
text-align: center;
}
body {
background-image: url(Register.jpg);
background-size: cover;
}
.s1 {
float:left;
}
.s2 {
float:right;
}
.s3 {
margin-left: 110px;
}
.s4 {
margin-left: 90px;
}
.s4 a {
color: black;
font-size: 12;
}
.s4 a:hover {
color: blue;
}
p {
font-size: 12;
color: red;
}
.d1{
margin-left:
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<jsp:include page="header.html"/>
<div class="container">
<div class="content">
<form class="page" method="post" action="RegisterPage" name="register">
<span class="s1">
First Name
</span>
<span class="s2">
<input name="firstname" placeholder="Firstname" id="firstname" required>
</span>
<br><br>
<span class="s1">
Last Name
</span>
<span class="s2">
<input name="lastname" placeholder="Lastname" id="lastname" required>
</span>
<br><br>
<span class="s1">
Date of Birth
</span>
<span class="s2">
<input id = "input1" name="dob" type="date" placeholder="DD-MM-YYYY" id="date" required>
</span>
<br><br>
<span class="s1">
Gender
</span>
<span class="s2">
<input id = "input2" type="radio" name="gen" value="Male" required>Male
<input id = "input2" type="radio" name="gen" value="Female">Female
</span>
<br><br>
<span class="s1">
Membership Type
</span>
<span class="s2">
<input id = "input2" type="radio" name="mem" value="Librarian" required>Librarian
<input id = "input2" type="radio" name="mem" value="Member">Member
</span>
<br><br>
<span class="s1">
Address
</span>
<span class="s2">
<input name="addr" placeholder="Address First Line" id="addr" required>
</span>
<br><br>
<span class="s1">
Contact Number
</span>
<span class="s2">
<input id = "input1" name="c_no" type="number" placeholder="9999888777" id="c_no" required>
</span>
<br><br>
<span class="s1">
Email ID
</span>
<span class="s2">
<input name="loginID" type="email" placeholder="abc@def.com" id="loginID" required>
</span>
<br><br>
<span class="s1">
Username
</span>
<span class="s2">
<input name="username" placeholder="Username" id="username" required>
</span>
<br><br>
<span class="s1">
Password
</span>
<span class="s2">
<input name="password" type = "password" placeholder="Password" id="pass" required>
</span>
<br><br>
<span class="s1">
Confirm Password
</span>
<span class="s2">
<input name="password1" type="password" placeholder="Confirm Password" id="pass1" required>
</span>
<br>
<div class="d1"><p>${error}</p></div>
<br><br>
<span class="s3"><input type="submit" value="Register" onClick="check()"></span>
<br><br>
<span class="s4">
<a href="Login.jsp">Already a user!! Login</a>
</span>
</form>
</div>
</div>
<jsp:include page="footer.html">
关于javascript - Jquery 代码不适用于密码确认,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45398930/
Internal Server Error: /admin/account/customuser/add/ Traceback (most recent call last): File "C:\
有问题!虽然我发现几乎相似的线程但没有帮助:( 我编写了一个 php 脚本来从我的 MySQL 数据库中获取注册用户的数量。该脚本在我的本地主机上运行良好;它使用给定的用户名、密码和主机名,分别是“r
我正在做一项基于密码的作业,我将 key 和消息放在单独的数组中。我想创建第三个数组,其中包含围绕消息大小的 key ,如下所示: message keykeyk 我已经在这个问题上苦苦挣扎了一段时间
我的几个客户要求我实现图形密码检查器,例如 关于如何实现这种 UI 有什么想法吗? 最佳答案 试着看看这个:https://code.google.com/p/android-lockpattern/
我正在使用 MAMP,每次登录 phpMyAdmin 时,都会收到以下错误/警告消息: the configuration file now needs a secret passphrase (bl
我正在尝试通过将 Visual Studio 2013 连接到我的测试机来调试 WDF 驱动程序。它创建一个名为 WDKRemoteUser 的用户,并在进行测试时尝试自动登录。有人知道这个用户的密码
使用具有指定用户名和密码的 SVN 提交。我希望服务器抛出错误;所以我可以告诉我的用户他/她的密码错误。 相反,在使用错误密码提交后: svn commit "test_file.txt" --use
我正在尝试实现 friend 推荐。 它从节点“你”开始。而且,我想找到节点“安娜”。 换句话说,这是我的两个或更多 friend 共同认识的人。上面的示例节点是 Anna。 如果您的帮助,我将不胜感
我都尝试过 wget --user=myuser --password=mypassword myfile 和 wget --ftp-user=myuser --ftp-password=mypass
我的一位用户提示说,每当他尝试使用默认管理界面(Django 的管理员)添加新用户(auth.User)时,新用户名和密码都会自动填充他自己的。 问题是他在登录时要求 Firefox 记住他的用户名/
我们正在开发一款应用(当然)用于应用购买 (IAP)。我已完成指南中的所有操作以启用 iap,并且一切正常,直到我想要购买为止。 部分代码: MainViewController.m -(vo
我试图创建两个可选匹配项的并集(如下所示),但我得到的不是并集,而是两者的交集。我应该如何更改此查询以获得所需的联合? optional match (a:PA)-[r2:network*2]-(b:
我想将Ansible用作另一个Python软件的一部分。在该软件中,我有一个包含其用户名/密码的主机列表。 有没有一种方法可以将SSH连接的用户/密码传递给Ansible ad-hoc命令或以加密方式
嗨,我在使用xampp的Apache Web服务器上收到错误500。直到我使用.htaccess,.htpasswd文件,错误才出现。我搜索了,但找不到语法错误。我只有1张图片和要保护的索引文件。以下
我一直使用它来编辑用户帐户信息: $this->validate($request, [ 'password' => 'min:6', 'password_confirmation'
我需要使用InstallUtil来安装C# Windows服务。我需要设置服务登录凭据(用户名和密码)。这一切都需要默默地完成。 有没有办法做这样的事情: installutil.exe myserv
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
如果我有一个随机的、16 个字符长的字母数字盐(不同大小写),它是为每个用户生成和存储的,我是否还需要一个站点范围的盐? 换句话说,这样好吗? sha1($user_salt . $password)
我正在开发一个空白程序,该程序将允许用户创建一个帐户,以便他们可以存储其余额和提款/存款。用户输入用户名和密码后,如何存储这些信息以便用户可以登录并查看其余额?我不一定要尝试使其非常安全,我只是希望能
我正在尝试寻找一种通用方法来搜索没有链接到另一个节点或节点集的节点或节点集。例如,我能够找到特定类型(例如 :Style)的所有节点,这些节点以某种方式连接到一组特定的节点(例如 :MetadataR
我是一名优秀的程序员,十分优秀!