dongtiao1817
dongtiao1817
采纳率100%
2014-01-06 19:07

Parsley.js - 密码验证不提交

已采纳

i have a problem with parsley.js. every time i hit the submit button it doesnt do anything. does anyone know a solution for this?

<!DOCTYPE html>
<html>

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Registrierung</title>

<link href="bootstrap-combined.min.css" rel="stylesheet"/>   
<script src="js/jquery-2.0.3.min.js"></script>
<script src="js/bootstrap-3.0.3.min.js"></script>
<script src="js/parsley.min.js"></script>
<script src="js/parsley.messages.de.js"></script>

</head>
<body class="body">

<?php
$fpw="";
?>
<div class="container">
<div class="offset4">
<div>
<h1>Registrierung</h1>
<?php if($fpw == true) echo '<div class="error" Passwörter stimmen nicht überein!<br></div>'; ?>
<form method="post" action="aregistrierung.php" data-validate="parsley">

<label for="passwort1" class="labbel">Passwort</label>
<input id="passwort1" name="passwort1" type="password" data-type="password" data-required="true" placeholder="Passwort" />

<label for="passwort2" class="labbel">Passwort bestätigen</label>
<input id="passwort2" name="passwort2" type="password" data-type="password" data-required="true" placeholder="Passwort" data-equalto="#passwort1" data-equalto-message="Passwort stimmt nicht überein"/>

<br><br>
<input name="registrieren" type="submit" value="Registrieren" class="btn btn-large btn-success"/>

</form>
</div>
</div>
</div>

</body>
</html>

i edited the whole file into it; i have tested it with a fake link like "sadfgkfe.php" too, it doesnt gave me the "not found" error.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • dqy27359 dqy27359 7年前

    As @Doodlebot said, use parsley-validate on the form.

    Remove data-type="password" - parsley has no password validation.

    Change the data- prefix to parsley-.

    Here is a sample fiddle.

    点赞 评论 复制链接分享
  • dtjwov4984 dtjwov4984 7年前

    Try replacing the form attribute data-validate="parsley" with parsley-validate and replace data-required="true" with required.

    点赞 评论 复制链接分享

为你推荐