{% extends "model-scope.html" %} {% load tutorial_tags %} {% block main-intro %}
Combine client-side Form validation with two-way data-binding
In this example, client-side Form validation is combined with two-way data-binding.
{% endblock main-intro %} {% block form_tag %}name="{{ form.form_name }}" method="post" action="." novalidate ng-controller="MyFormCtrl"{% endblock %} {% block form_submission %}
Test submission of invalid Form data:
If a Form inherits from both mixin classes NgModelFormMixin
and
NgFormValidationMixin
, then django-angular combines
client-side validation with AngularJS's
model scope.
Refer to the previous examples for a detailed explanation.
{% endblock main-tutorial %} {% block main-sample-code %} {% autoescape off %}This configuration is the most flexible one. Use it on productive web-sites.
Note: The submit buttons are disabled, until the client-side Form validation has
validated all the fields.