Parsley.js is not valid when using data-parsley-min

0

I have a password field type="password" that I use parsley like this:

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

But it is not validating right, because it should check if it has a minimum of 6 characters. Why did you go wrong?

    
asked by anonymous 22.05.2017 / 17:05

1 answer

0

Personally, I prefer to apply Parsley to the form through Javascript since Javascript may be required for custom validations (see parsley advanced validations). 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>
    
22.05.2017 / 17:07