点击提交按钮 弹出一个警告窗口代码,提示密码错误,不需要密码正确,和这个代码怎么改? 100
<scriptlanguage="javascript">functioncheckform(form){username=form.username.value;pas...
<script language="javascript" >
function checkform(form)
{
username=form.username.value;
password=form.password.value;
checkcode=form.CheckCode.value;
var errString="";
if(username==""){
errString +="请输入用户名.\n";
}
if(password==""){
errString +="请输入密码.\n";
}
if(checkcode==""){
errString +="请输入验证码.\n";
}
if(errString!="")
{
alert(errString);
return false;
}
}
</script>
<style>
#formwrapper {
width:420px;
padding:20px;
text-align:left;
color:#666666;
}
fieldset {
padding:10px;
margin-top:5px;
border:1px solid #1E7ACE;
background:#fff;
color:#666666;
}
fieldset a {
color:#1E7ACE;
text-decoration:none;
}
fieldset a:hover {
color:#000;
text-decoration:none;
}
fieldset pre,p {
color:#1E7ACE;
margin:4px;
}
input, select,textarea {
padding:1px;
margin:2px;
font-size:12px;
}
.button{
padding:1px 10px;
font-size:12px;
border:1px #1E7ACE solid;
background:#D0F0FF;
cursor:hand;
}
fieldset legend {
color:#1E7ACE;
font-weight:bold;
padding:3px 20px 3px 20px;
border:1px solid #1E7ACE;
background:#fff;
}
fieldset label {
float:left;
width:120px;
text-align:right;
padding:4px;
margin:1px;
}
fieldset div {
clear:left;
margin-bottom:2px;
}
.forgotpass{text-align:right;}
</style>
<script language="javascript" >
document.getElementById("error").style.display="none";
</script>
<div style="margin-top:30px; font-size:12px; color: #0066CC">
</div>
<div id="formwrapper">
<form action="userlogin.asp" method="post" id="frmLogin" onsubmit="return checkform(this);">
<input type="hidden" name="action" value="login" />
<input type="hidden" name="pre_url" value="" />
<input type="hidden" name="displaytype" value="0" />
<fieldset>
<legend>本站会员登陆</legend>
<div>
<label for="name">用户名:</label>
<input name="username" type="text" id="username" tabindex="1" size="18" maxlength="30" value=""> <a href="userreg.asp" style="color: #005775">没有注册?</a><br />
</div>
<div>
<label for="password">密码:</label>
<input name="password" type="password" id="password" tabindex="2" size="18" maxlength="15" />
</div>
<div>
</div>
<div class="cookiechk" style="margin-top:10px">
<label for="login"></label>
<input name="Submit" type="submit" class="button" value=" 登 陆 " />
</div>
<div class="forgotpass"><!--a href="/pswback.php">忘记密码?</a--> <a href="userreg.asp">没有注册?</a></div>
</fieldset>
</form> 展开
function checkform(form)
{
username=form.username.value;
password=form.password.value;
checkcode=form.CheckCode.value;
var errString="";
if(username==""){
errString +="请输入用户名.\n";
}
if(password==""){
errString +="请输入密码.\n";
}
if(checkcode==""){
errString +="请输入验证码.\n";
}
if(errString!="")
{
alert(errString);
return false;
}
}
</script>
<style>
#formwrapper {
width:420px;
padding:20px;
text-align:left;
color:#666666;
}
fieldset {
padding:10px;
margin-top:5px;
border:1px solid #1E7ACE;
background:#fff;
color:#666666;
}
fieldset a {
color:#1E7ACE;
text-decoration:none;
}
fieldset a:hover {
color:#000;
text-decoration:none;
}
fieldset pre,p {
color:#1E7ACE;
margin:4px;
}
input, select,textarea {
padding:1px;
margin:2px;
font-size:12px;
}
.button{
padding:1px 10px;
font-size:12px;
border:1px #1E7ACE solid;
background:#D0F0FF;
cursor:hand;
}
fieldset legend {
color:#1E7ACE;
font-weight:bold;
padding:3px 20px 3px 20px;
border:1px solid #1E7ACE;
background:#fff;
}
fieldset label {
float:left;
width:120px;
text-align:right;
padding:4px;
margin:1px;
}
fieldset div {
clear:left;
margin-bottom:2px;
}
.forgotpass{text-align:right;}
</style>
<script language="javascript" >
document.getElementById("error").style.display="none";
</script>
<div style="margin-top:30px; font-size:12px; color: #0066CC">
</div>
<div id="formwrapper">
<form action="userlogin.asp" method="post" id="frmLogin" onsubmit="return checkform(this);">
<input type="hidden" name="action" value="login" />
<input type="hidden" name="pre_url" value="" />
<input type="hidden" name="displaytype" value="0" />
<fieldset>
<legend>本站会员登陆</legend>
<div>
<label for="name">用户名:</label>
<input name="username" type="text" id="username" tabindex="1" size="18" maxlength="30" value=""> <a href="userreg.asp" style="color: #005775">没有注册?</a><br />
</div>
<div>
<label for="password">密码:</label>
<input name="password" type="password" id="password" tabindex="2" size="18" maxlength="15" />
</div>
<div>
</div>
<div class="cookiechk" style="margin-top:10px">
<label for="login"></label>
<input name="Submit" type="submit" class="button" value=" 登 陆 " />
</div>
<div class="forgotpass"><!--a href="/pswback.php">忘记密码?</a--> <a href="userreg.asp">没有注册?</a></div>
</fieldset>
</form> 展开
1个回答
展开全部
你这个问题我看不懂 给我好好说说
不知道你是不是这个意思
function checkform(form)
{
username=form.username.value;
password=form.password.value;
checkcode=form.CheckCode.value;
var errString="";
if(username==""){
errString +="请输入用户名.\n";
}
if(password==""){
errString +="请输入密码.\n";
}
if(checkcode==""){
errString +="请输入验证码.\n";
}
if(errString!="")
{
alert(errString);
return false;
}
alert("密码错误!");
return false;
}
不知道你是不是这个意思
function checkform(form)
{
username=form.username.value;
password=form.password.value;
checkcode=form.CheckCode.value;
var errString="";
if(username==""){
errString +="请输入用户名.\n";
}
if(password==""){
errString +="请输入密码.\n";
}
if(checkcode==""){
errString +="请输入验证码.\n";
}
if(errString!="")
{
alert(errString);
return false;
}
alert("密码错误!");
return false;
}
来自:求助得到的回答
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |