Parsley.js does not validate when using data-Parsley-min

Asked

Viewed 128 times

0

I have a password field type="password" that I use Parsley in this way:

<input type="password" name="senha_usu" id="pass2" class="form-control" required data-parsley-min="6" placeholder="Senha" />

but it’s not validating right, because I should check if it has at least 6 characters. Because of the going wrong?

1 answer

0

Personally, I prefer to apply Parsley to the form through Javascript since Javascript may be required for custom validations (see advanced validations with Parsley). To apply Parsley through Javascript, we can use the following code:

 <script src="jquery.js"></script>
<script src="i18n/pt-br.js"></script>
<script src="i18n/es.js"></script>
<script src="parsley.min.js"></script>
<script type="text/javascript">
	window.ParsleyValidator.setLocale('pt-br');
</script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.