javascript - Django and Parsley.js - works only for email field -
i need validate django form on client side, decided use parsley. but... validation works email. not able validate other fields such login or password.
here of code related problem.
template:
<script type="text/javascript" src="/media/jquery-2.1.1.js"></script> <script type="text/javascript" src="/media/parsley.js"></script>
...
<form data-parsley-validate method="post" action="register">
form:
from parsley.decorators import parsleyfy @parsleyfy class registerform(forms.form): username = forms.charfield(label="login:",min_length=3,max_length=30,required=true) email = forms.emailfield(label="email:") password1 = forms.charfield(label="hasło:",widget=forms.passwordinput()) password2 = forms.charfield(label="powtórz hasło:",widget=forms.passwordinput()) phone = forms.charfield(label="telefon:",max_length=20,required=false) log_on = forms.booleanfield(label="logowanie po rejestracji:",required=false)
rendered:
<labelr="id_username">login:</label> <input id="id_username" type="text" name="username" maxlength="30" data-parsley-required-message="to pole jest wymagane." data-parsley-required="true" data-parsley-minlength="3" data-parsley-maxlength="30"> <label for="id_email">email:</label> <input id="id_email" type="email" name="email" data-parsley-type="email" data-parsley-required-message="to pole jest wymagane." data-parsley-required="true">
http://i.imgur.com/cpnw8bb.png
can help?
Comments
Post a Comment