扫码关注官方订阅号
有无解决方案
ringa_lee
<form name="signup_form" novalidate ng-submit="signupForm(signup_form)" ng-controller="signupController"> <fieldset> <legend>Signup</legend> <p class="row"> <p class="large-12 columns"> <label>Your name</label> <input type="text" placeholder="Name" name="name" ng-model="signup.name" ng-minlength="3" ng-maxlength="20" required /> <p class="error" ng-show="signup_form.name.$dirty && signup_form.name.$invalid && submitted">//修改了 <small>error here</small> </p> </p> </p> <button type="submit" >Submit</button> </fieldset> </form> <script> app.controller('signupController', function($scope) { $scope.submitted = false; $scope.signupForm = function(form) { if (form.$valid) { // } else { $scope.submitted = true;//修改了 } } }); </script>
plunker 请戳这里
推荐使用https://github.com/huei90/angular-valida...
http://stackoverflow.com/questions/18798...
百度angular form,一大堆例子,还有讲解,在这问多浪费时间呀。
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
plunker 请戳这里
推荐使用https://github.com/huei90/angular-valida...
http://stackoverflow.com/questions/18798...
百度angular form,一大堆例子,还有讲解,在这问多浪费时间呀。