Ticket #2841: forms.diff

File forms.diff, 1.0 KB (added by Simon G. <dev@…>, 18 years ago)
  • docs/forms.txt

     
    517517When are validators called?
    518518---------------------------
    519519
    520 After a form has been submitted, Django first checks to see that all the
    521 required fields are present and non-empty. For each field that passes that
    522 test *and if the form submission contained data* for that field, all the
    523 validators for that field are called in turn. The emphasized portion in the
     520After a form has been submitted, Django validates each field in turn. First,
     521if the field is required, Django checks that it is present and non-empty. Then,
     522if that test passes *and the form submission contained data* for that field, all
     523the validators for that field are called in turn. The emphasized portion in the
    524524last sentence is important: if a form field is not submitted (because it
    525525contains no data -- which is normal HTML behavior), the validators are not
    526526run against the field.
Back to Top