我有一个表格,我检查密码是否相同,但我收到Unexpected end of input
错误。谁能告诉我我的错误在哪里?
JS代码:
<script>
$( document ).ready(function() {
$( "form" ).submit(function(event) {
var $form = $( this );
if( $form.find( '#password').val() !== $form.find( '#password2' ).val()) {
event.preventDefault();
alert( 'Passwords do not match.' );
}
});
</script>
并形成html代码:
<form name="form1" method="post" action="process_reset.php">
<img src="../images/login_icon.png" class="form-icon"/><div id="clr"></div><span style="float: left;padding-left: 10px;">
<b>Welcome admin.</b> <i>Reset your password</i></span><br/>
<input name="password" type="text" class="login-text-lbl" placeholder="password" id="password"><div id="clr"></div>
<input name="password2" type="password2" class="login-text-lbl" placeholder="repeat password" id="password2"><div id="clr"></div>
<input name="admin_id" type="text" value="<? echo $client_id; ?>" style="display: none;" id="admin_id"/>
<input type="submit" id="resetBtn" name="Submit" value="Reset password" class="login-button">
</form>