My mind is here:

class Register(forms.Form):
    passwd = 
forms.CharField(max_length=20,label='密码',widget=forms.PasswordInput)
    repasswd = 
forms.CharField(max_length=20,label='重复密码',widget=forms.PasswordInput)

def clean_passwd(self):
    passwd = self.cleaned_data['passwd']
    repasswd = self.cleaned_data['repasswd'] #here is error

    if passwd != repasswd:
        raise forms.ValidationError('两次密码不一致')
    return passwd

So,problems is i want to check passwd and repasswd same,How to solve?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ab8a7050-37c8-4547-9b86-5bd16821ede9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to