---
title: "Form Validation  in AngularJS"  
description: "Form Validation  in AngularJS"  
author: "Anonymous User"  
published: 2016-02-23  
updated: 2016-02-23  
canonical: https://www.mindstick.com/forum/33997/form-validation-in-angularjs  
category: "angular js"  
tags: ["jquery", "angular js"]  
reading_time: 2 minutes  

---

# Form Validation  in AngularJS

We want to [Validate](https://www.mindstick.com/forum/1490/what-is-better-solution-for-validate-form-textboxs-value) [Form](https://www.mindstick.com/forum/6/multi-form-mfc-application) in AngularJS. How to do this please help me.

## Replies

### Reply by Anonymous User

```
@{    Layout = null;}<!DOCTYPE html><html><head>    <meta name="viewport" content="width=device-width" />    <script src="~/Scripts/jquery-1.9.1.js"></script>    <script src="~/Scripts/angular.js"></script>    <title>Forum</title>  <script>      var app = angular.module('myApp', []);      app.controller('validationCtrl', function ($scope) {          $scope.name = 'Aditya';          $scope.email = 'aditya06630h@gmail.com';          $scope.password = '********';          $scope.city = 'allahabad';          $scope.country = 'India';          $scope.mobile = '8953249451';      });</script>  </head><body>    Form Vailidation    <form ng-app="myApp" ng-controller="validationCtrl" name="myForm" novalidate>           <table>             <tr>                  <td>Name:                  </td>                  <td></td>                 <td>                     <input type="text" name="user" ng-model="name" required>                     <span style="color: red" ng-show="myForm.name.$dirty && myForm.name.$invalid">  <span ng-show="myForm.name.$error.required">Username is required.</span>                      </span>                  </td>            </tr>                <tr>                    <td>                        Email: </td>                    <td></td>                    <td>                        <input type="email" name="email" ng-model="email" required>                        <span style="color: red" ng-show="myForm.email.$dirty && myForm.email.$invalid">    <span ng-show="myForm.email.$error.required">Email is required.</span>                        <span ng-show="myForm.email.$error.email">Invalid email address.</span>                        </span>                    </td>                </tr>                <tr>                    <td>Password:                    </td>                    <td></td>                    <td>                        <input type="text" name="password" ng-model="password" required>                        <span style="color: red" ng-show="myForm.password.$dirty && myForm.password.$invalid">    <span ng-show="myForm.password.$error.required">Password is required.</span>                        </span>                    </td>                </tr>                <tr>                    <td>City:                    </td>                    <td></td>                    <td>                        <input type="text" name="city" ng-model="city" required>                        <span style="color: red" ng-show="myForm.city.$dirty && myForm.city.$invalid">    <span ng-show="myForm.city.$error.required">City is required.</span>                        </span>                  </td>                </tr>                <tr>                    <td>Country:                    </td>                    <td></td>                    <td>                        <input type="text" name="country" ng-model="country" required>                        <span style="color: red" ng-show="myForm.country.$dirty && myForm.country.$invalid">    <span ng-show="myForm.country.$error.required">Country is required.</span>                        </span>                    </td>                </tr>                <tr>                    <td>Mobile:                    </td>                    <td></td>                    <td>                        <input type="text" name="mobile" ng-model="mobile" required>                        <span style="color: red" ng-show="myForm.mobile.$dirty && myForm.mobile.$invalid">    <span ng-show="myForm.mobile.$error.required">Mobile is required.</span>                        </span>                  </td>                </tr>                <tr>                    <td></td>                    <td></td>                    <td>                        <input type="submit" ng-disabled="myForm.user.$dirty && myForm.user.$invalid || myForm.email.$dirty                         && myForm.email.$invalid || myForm.password.$dirty && myForm.password.$invalid || myForm.city.$dirty                         && myForm.city.$invalid || myForm.country.$dirty && myForm.country.$invalid || myForm.mobile.$dirty                         && myForm.mobile.$invalid" />                    </td>                </tr>            </table>        </form>    </body>  </html>
```

```

```


---

Original Source: https://www.mindstick.com/forum/33997/form-validation-in-angularjs

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
