How can I simplify form validation?

前端 未结 11 1510
[愿得一人]
[愿得一人] 2020-12-14 00:57

The code below seems to work pretty well for doing basic required form validation.

The form displays a red Name is required message when the field is dirty

11条回答
  •  不知归路
    2020-12-14 01:59

    index.php

    Required!

    Password Is Very Short.

    Password Is Very Long.

    In app.js include this function :

     $scope.submitForm = function() {
         if ($scope.myForm.$valid) {
             alert('Our Form Is Submited....');
         }
     };
    

提交回复
热议问题