尝试在登录失败时显示提交按钮,但无法显示。
我的代码:-
<html>
<head>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" ></script>
<style>
.hiddenFramehideclass {
position: absolute;
top: -1px;
left: -1px;
width: 1px;
height: 1px;
}
</style>
</head>
<body>
<form method="post" class="needs-validation" action="" enctype="multipart/form-data" id="loginform" target="hiddenFrame">
<h2>Login</h2>
<hr />
<label for="emailid">Email: </label>
<input id="emailid" type="text" placeholder="Email" name="txtulogindetail" required />
<br /><br /><br />
<label for="passwordid">Password: </label>
<input id="passwordid" type="password" placeholder="Password" name="txtupass" required />
<hr />
<button type="submit" class="btn btn-success" name="btn-login" id="loginsubmitbutton">Sign in</button>
<br /><br /><br />
<span id="register_link"> <a href= "register">Register!</a></span>
<hr />
</form>
<iframe name="hiddenFrame" class="hiddenFramehideclass"></iframe>
</body>
<script>
/*Submit Button Clicked Function Starts */
$("#loginsubmitbutton").click(function() {
$("#loginsubmitbutton").hide(); //Hiding submit button
$("#register_link").hide(); //Hiding Register Link
/*Making Inputs to readonly Starts*/
$("input").css({
'pointer-events': 'none'
});
/*Making Inputs to readonly Ends*/
});
/*Submit Button Clicked Function Ends */
</script>
因此,当我尝试使用上述代码登录时:
当凭据正确时,它会提醒“已登录” 。
仅当凭据不正确(密码不正确)时,它才会发出错误警报(但根据代码,它应该再次显示提交按钮。)
当未找到电子邮件时,它会提醒电子邮件未找到
缥缈止盈
ABOUTYOU