我使用这个代码:jQuery .submit没有被触发?
$j("#register-form form").submit(function() {
if ($j("input:first").val() == "correct") {
$j("#registration-notification").animate({
height: "21px",
opacity: 1,
'padding-top': "8px"
}, 800);
return true;
}
$j("span").text("Not valid!").show().fadeOut(1000);
return false;
});
这种形式(从萤火虫代码):
<div id="register-form">
<form class="bbp-login-form" action="http://localhost/taiwantalkorgfinal2/wp-login.php" method="post">
<fieldset class="bbp-form">
<h5>Create a Taiwantalk account</h5>
<div class="bbp-username">
<div class="bbp-email">
<div class="bbp-submit-wrapper">
</fieldset>
</form>
,使这个通知出现:
HTML:
<div id="registration-notification">
<div id="message">
<span><?php _e('Check your email for the username and password'); ?></span>
<a href="#" id="close-button">x</a>
</div>
</div><!-- #container -->
CSS:
#registration-notification {
background-color: #444;
color: #FFF;
height: 0;
opacity: 0;
padding: 0;
overflow: hidden;
#close-button {
background: #888;
color: #FFF;
float: right;
padding: 0 3px;
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
behavior: url(PIE.htc);
&:hover {
background: #BA422B;
color: #FFF;
}
}
#message {
margin: 0 auto;
width: 940px;
span {
float: left;
width: 720px;
}
a {
color: #FFF;
font-weight: bold;
}
}
}
#header {
overflow: hidden;
padding: 9px 0 0;
h1 {
float: left;
height: 19px;
width: 115px;
margin: 1px 20px 0 0;
a {
background: url("images/logo.png") no-repeat scroll 0 0 transparent;
float: left;
height: 19px;
text-indent: -9999px;
width: 115px;
}
}
}
但由于某些原因,在第一输入键入“正确的”,并点击提交后,我仍然得到“无效”。信息。任何建议来解决这个问题?
$ j可以附加$ J( “#寄存器形式>表 ”)我认为 – galchen