Question

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.

Était-ce utile?

La solution

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.

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top