如何在PHP的PHP中运行带有Html + AngularJS的表单?

时间:2015-07-17 23:26:09

标签: php jquery html angularjs

如果我这样做,这个AngularJS就像一个魅力:

WKWebView

它有一个很棒的结果,如果我在该输入标签中填写引号,那么AngularJS会给出预防,我真的很喜欢它。

但是AngularJS不起作用(没有任何反应),如果我把这个表单放在PHP上,而它有相同的代码,如下所示:

<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
</head>
<body ng-app="ctrljs">
    <a href='#' data-toggle='modal' data-target='#mlmid'>cobacing</a>

                                <div class='modal fade' id='mlmid' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
                                  <div class='modal-dialog'>
                                    <div class='modal-content'>
                                      <div class='modal-body'>
                                        <form method='post' action='' name='myForm' ng-controller='formctrl'>
                                            Nomor ID Member C2G: <br>
                                            <input type='text' name='mlmidbaru' ng-model='mlmidbaru' required ng-pattern="/^[A-Za-z0-9]*$/"></input>
                                            <span class='errorcolor' ng-show='myForm.mlmidbaru.$error.pattern'><span class='label label-danger'><span class='glyphicon glyphicon-remove'></span></span> <font color='red'>invalid value</font></span>
                                            <input type='submit' value='submit' ng-hide="!myForm.$valid"></input>
                                        </form>
                                      </div>
                                    </div><!-- /.modal-content -->
                                  </div><!-- /.modal-dialog -->
                                </div><!-- /.modal -->

    <script>
        var app = angular.module('ctrljs', []);
        app.controller('formctrl', function($scope, $http){
             $scope.digits = {};
        });
    </script>
</body>
</html>

任何人都可以帮助我吗?因为我想使用AngularJS来解析我的验证表单。感谢。

0 个答案:

没有答案