jquery - How do I run a form with Html+AngularJS inside a While of PHP? -


this angularjs works charm, if this:

<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> 

it has awesome result if fill quotes marks in input tag, angularjs give prevention, it.

but angularjs doesn't work (nothing happens), if put form inside while on php whereas has same code, this:

<html> <head> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> </head> <body ng-app="ctrljs"> <?php                 $query2="select * t_un order ai desc";                 $qdb=mysql_query("$query2");                 while($fqdb=mysql_fetch_object($qdb)){                     echo "<tr bgcolor='".($fqdb->webstatus=="inactive"?"#f6ced8":"#cef6f5")."' id='white' onclick='swapbg(this)'><td>$no.</td><td>$fqdb->ai</td><td><a href='?namesearch=$fqdb->username&submit=yes'>$fqdb->username</a></td><td nowrap>$fqdb->namealias</td><td nowrap>$fqdb->hu</td><td nowrap><a href='#' data-toggle='modal' data-target='#mlmid'>$fqdb->mlmid</a></td><td>$fqdb->sponsor</td><td>$fqdb->upline</td><td nowrap>$fqdb->city</td><td>$fqdb->email</td><td>$fqdb->hp</td><td>$fqdb->bb</td><td nowrap>$fqdb->it</td><td nowrap><a href='?page=gantive&email=$fqdb->email' onclick=\"return confirm('are sure?')\">$fqdb->ve</a></td><td>$fqdb->sub</td></tr>"; ?>                                 <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 --> <?php                     $no=$no+1;                 } ?>     <script>         var app = angular.module('ctrljs', []);         app.controller('formctrl', function($scope, $http){              $scope.digits = {};         });     </script> </body> </html> 

can me? because use angularjs resolve validation form. thanks.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -