{"id":2647,"date":"2015-03-17T12:15:32","date_gmt":"2015-03-17T10:15:32","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=2647"},"modified":"2018-06-20T16:17:58","modified_gmt":"2018-06-20T13:17:58","slug":"angular-js-form-validation-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/","title":{"rendered":"Angular.js Form Validation Example"},"content":{"rendered":"<p><strong>EDITORIAL NOTE<\/strong>: In this post, we feature a comprehensive Angular.js Form Validation Example.<\/p>\n<p>One of\u00a0AngularJS advantages is the simplicity it provides for validating forms. Today&#8217;s example demonstrates a simple way to implement client-side validation using the AngularJS form properties.<\/p>\n<p>Suppose a form with two fields, username and email and two buttons, one for reset and the other with a submit role. Our example&#8217;s concept is that both of the form&#8217;s fields are required, so the form cannot be submitted if either of these is empty or has invalid format (i.e. the email).<\/p>\n<p>[ulp id=&#8217;LXJcMJZXSsqGXYW8&#8242;]<\/p>\n<h2>1. View Page<\/h2>\n<p>The best way to take advantage of Angular&#8217;s abilities, according to form validation, is to attach a <a href=\"https:\/\/docs.angularjs.org\/api\/ng\/directive\/ngController\" target=\"_blank\" rel=\"noopener\">controller<\/a> to our form.<\/p>\n<p><u><code>index.html<\/code><\/u><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;link rel=&quot;stylesheet&quot; href=&quot;https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/2.3.2\/css\/bootstrap.min.css&quot;&gt;\r\n&lt;script src=&quot;http:\/\/ajax.googleapis.com\/ajax\/libs\/angularjs\/1.2.26\/angular.min.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script src=&quot;script.js&quot;&gt;&lt;\/script&gt;\r\n&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; &gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n&lt;h2&gt;AngularJS Form Validation Example&lt;\/h2&gt;\r\n&lt;form ng-controller=&quot;validationCtrl&quot; name=&quot;sampleForm&quot; novalidate&gt;\r\n\t&lt;p&gt;\r\n\t\t&lt;label&gt;Username:&lt;\/label&gt;\r\n\t\t&lt;input type=&quot;text&quot; class=&quot;form-control&quot; name=&quot;username&quot; ng-model=&quot;username&quot; required &gt;\r\n\t\t&lt;span ng-show=&quot;sampleForm.username.$error.required&quot;&gt;Username is required.&lt;\/span&gt;\r\n\t&lt;\/p&gt;\r\n\t&lt;p&gt;\r\n\t\t&lt;label&gt;Email:&lt;\/label&gt;\r\n\t\t&lt;input type=&quot;email&quot; class=&quot;form-control&quot; name=&quot;email&quot; ng-model=&quot;email&quot; required&gt;\r\n\t\t&lt;span ng-show=&quot;sampleForm.email.$error.required&quot;&gt;Email is required.&lt;\/span&gt;\r\n\t\t&lt;span ng-show=&quot;sampleForm.email.$error.email&quot;&gt;Invalid email address.&lt;\/span&gt;\r\n\t&lt;\/p&gt;\r\n\t&lt;p&gt;\r\n\t\t&lt;button class=&quot;btn btn-link&quot; ng-click=&quot;reset()&quot;&gt;Reset&lt;\/button&gt;\r\n\t\t&lt;input type=&quot;submit&quot; class=&quot;btn btn-primary&quot; ng-disabled=&quot;sampleForm.$invalid&quot; ng-click=&quot;checkData()&quot;&gt;\r\n\t&lt;\/p&gt;\r\n&lt;\/form&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>As you make clear from the <code>head<\/code>&#8216;s definition, I decided to separate HTML from Javascript and CSS.<\/p>\n<p>Line 12 declares clarifies that our form is attached to <code>validationCtrl<\/code> and yes, your guess is right, the <code>script.js<\/code> will contain the controller&#8217;s logic, which will be nothing more than a handler for our form&#8217;s buttons.<\/p>\n<p>A typical client-side validation process contains error messages, for the cases of invalid (email) or blank input fields.<\/p>\n<p><i>In Angular, there are discrete form states, such as <code>$dirty<\/code> or <code>$invalid<\/code>, for user-interaction check with the form and for invalid input fields check, respectively. To read more about form properties, refer to the official <a href=\"https:\/\/docs.angularjs.org\/api\/ng\/type\/form.FormController\" target=\"_blank\" rel=\"noopener\">documentation<\/a>.<\/i><\/p>\n<p>Generally, this means that we partially want extra messages to be displayed in our webapp. AngularJS provides the <a href=\"https:\/\/docs.angularjs.org\/api\/ng\/directive\/ngShow\" target=\"_blank\" rel=\"noopener\"><code>ng-show<\/code><\/a> directive for this purpose, which, in conjunction with the form&#8217;s states, results to the client-side validation. Lines 16 and 21-22 implement the validation in the AngularJS way.<\/p>\n<p>We want our submit button to be disabled, while the form is invalid (line 26). AngularJS provides <a href=\"https:\/\/docs.angularjs.org\/api\/ng\/directive\/ngDisabled\" target=\"_blank\" rel=\"noopener\"><code>ng-disabled<\/code><\/a> directive to make this feasible.<\/p>\n<p>Finally, we clarify that we want our controller to run a specific function for each of the form&#8217;s buttons, using <a href=\"https:\/\/docs.angularjs.org\/api\/ng\/directive\/ngClick\" target=\"_blank\" rel=\"noopener\"><code>ng-click<\/code><\/a> directive.<\/p>\n<h2>2. Controller&#8217;s Functionality<\/h2>\n<p>When our form has a valid state, the submit buttons gets enabled. Suppose there is a predefined acceptable username and email from the webapp and that this the purpose of the reset button: to turn our form to its acceptable format. On the other hand, the submit has to check if the form contains the correct data.<\/p>\n<p>According to AngularJS, the glue between the application controller and the view, is the <a href=\"https:\/\/docs.angularjs.org\/guide\/scope\" target=\"_blank\" rel=\"noopener\"><code>$scope<\/code><\/a> object.<\/p>\n<p><u><code>script.js<\/code><\/u><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nfunction validationCtrl($scope) {\r\n   var validUsername = &quot;Thodoris Bais&quot;;\r\n   var validEmail = &quot;thodoris.bais@gmail.com&quot;;\r\n   \r\n   $scope.reset = function(){\r\n\t\t$scope.username = validUsername;\r\n\t\t$scope.email = validEmail;\r\n   }   \r\n   \r\n   $scope.checkData = function() {\r\n\t\tif ($scope.username != validUsername || $scope.email != validEmail) {\r\n\t\t\talert(&quot;The data provided do not match with the default owner&quot;);\r\n\t\t} else {\r\n\t\t\talert(&quot;Seems to be ok!&quot;);\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<h2>3. Demo<\/h2>\n<p>Let&#8217;s run our app:<\/p>\n<figure id=\"attachment_2703\" aria-describedby=\"caption-attachment-2703\" style=\"width: 563px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/app_initial.png\"><img decoding=\"async\" class=\"size-full wp-image-2703\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/app_initial.png\" alt=\"Figure 1. Initial screenshot of webapp\" width=\"563\" height=\"214\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/app_initial.png 563w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/app_initial-300x114.png 300w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/a><figcaption id=\"caption-attachment-2703\" class=\"wp-caption-text\">Figure 1. Initial screenshot of webapp<\/figcaption><\/figure>\n<p>After leaving the email field blank, here&#8217;s the job of <code>ng-show<\/code>:<\/p>\n<figure id=\"attachment_2704\" aria-describedby=\"caption-attachment-2704\" style=\"width: 578px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/email_req.png\"><img decoding=\"async\" class=\"size-full wp-image-2704\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/email_req.png\" alt=\"Figure 2. Email cannot be blank\" width=\"578\" height=\"209\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/email_req.png 578w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/email_req-300x108.png 300w\" sizes=\"(max-width: 578px) 100vw, 578px\" \/><\/a><figcaption id=\"caption-attachment-2704\" class=\"wp-caption-text\">Figure 2. Email cannot be blank<\/figcaption><\/figure>\n<p>Having provided the valid input data, we firstly notice that the submit button get enabled (both fields have now a green\/valid border) :<\/p>\n<figure id=\"attachment_2707\" aria-describedby=\"caption-attachment-2707\" style=\"width: 571px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/success.png\"><img decoding=\"async\" class=\"size-full wp-image-2707\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/success.png\" alt=\"Figure 3. Successful input\" width=\"571\" height=\"217\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/success.png 571w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/success-300x114.png 300w\" sizes=\"(max-width: 571px) 100vw, 571px\" \/><\/a><figcaption id=\"caption-attachment-2707\" class=\"wp-caption-text\">Figure 3. Providing valid data<\/figcaption><\/figure>\n<h2>4. Download the project<\/h2>\n<p>This was an example of AngularJS Form Validation.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here : <a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/angularjs_form_validation.zip\"><strong>angularjs_form_validation.zip<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>EDITORIAL NOTE: In this post, we feature a comprehensive Angular.js Form Validation Example. One of\u00a0AngularJS advantages is the simplicity it provides for validating forms. Today&#8217;s example demonstrates a simple way to implement client-side validation using the AngularJS form properties. Suppose a form with two fields, username and email and two buttons, one for reset and &hellip;<\/p>\n","protected":false},"author":63,"featured_media":909,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-2647","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-angular-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Angular.js Form Validation Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Interested to learn more about form validation? Then check out our Example on how to implement client-side validation using the AngularJS form properties!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular.js Form Validation Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about form validation? Then check out our Example on how to implement client-side validation using the AngularJS form properties!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/toubou.techblog\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-03-17T10:15:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-06-20T13:17:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Thodoris Bais\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ThodorisBais\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thodoris Bais\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/\"},\"author\":{\"name\":\"Thodoris Bais\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/f622d6017801d9aa8131e1ae69bbdd0d\"},\"headline\":\"Angular.js Form Validation Example\",\"datePublished\":\"2015-03-17T10:15:32+00:00\",\"dateModified\":\"2018-06-20T13:17:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/\"},\"wordCount\":825,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"articleSection\":[\"Angular.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/\",\"name\":\"Angular.js Form Validation Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"datePublished\":\"2015-03-17T10:15:32+00:00\",\"dateModified\":\"2018-06-20T13:17:58+00:00\",\"description\":\"Interested to learn more about form validation? Then check out our Example on how to implement client-side validation using the AngularJS form properties!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Angular.js\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/angular-js\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Angular.js Form Validation Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/f622d6017801d9aa8131e1ae69bbdd0d\",\"name\":\"Thodoris Bais\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dc31ee119255c1e4aa4a4f34858284d907cce53d033584d86b0e3de46db7d0ff?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dc31ee119255c1e4aa4a4f34858284d907cce53d033584d86b0e3de46db7d0ff?s=96&d=mm&r=g\",\"caption\":\"Thodoris Bais\"},\"description\":\"Thodoris is an Oracle Certified Associate Java Programmer and currently works as a Junior Software Developer, for Intrasoft International S.A. He holds a diploma at Informatics &amp; Telecommunications Engineering and is interested in continuous development.\",\"sameAs\":[\"http:\/\/thodorisbais.blogspot.com\",\"https:\/\/www.facebook.com\/toubou.techblog\/\",\"https:\/\/instagram.com\/thodoris.bais\/\",\"https:\/\/www.linkedin.com\/pub\/thodoris-bais\/69\/6b7\/408\",\"https:\/\/x.com\/@ThodorisBais\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/thodoris-bais\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular.js Form Validation Example - Web Code Geeks - 2026","description":"Interested to learn more about form validation? Then check out our Example on how to implement client-side validation using the AngularJS form properties!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/","og_locale":"en_US","og_type":"article","og_title":"Angular.js Form Validation Example - Web Code Geeks - 2026","og_description":"Interested to learn more about form validation? Then check out our Example on how to implement client-side validation using the AngularJS form properties!","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/toubou.techblog\/","article_published_time":"2015-03-17T10:15:32+00:00","article_modified_time":"2018-06-20T13:17:58+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","type":"image\/jpeg"}],"author":"Thodoris Bais","twitter_card":"summary_large_image","twitter_creator":"@ThodorisBais","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Thodoris Bais","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/"},"author":{"name":"Thodoris Bais","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/f622d6017801d9aa8131e1ae69bbdd0d"},"headline":"Angular.js Form Validation Example","datePublished":"2015-03-17T10:15:32+00:00","dateModified":"2018-06-20T13:17:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/"},"wordCount":825,"commentCount":1,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","articleSection":["Angular.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/","name":"Angular.js Form Validation Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","datePublished":"2015-03-17T10:15:32+00:00","dateModified":"2018-06-20T13:17:58+00:00","description":"Interested to learn more about form validation? Then check out our Example on how to implement client-side validation using the AngularJS form properties!","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-form-validation-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"Angular.js","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/angular-js\/"},{"@type":"ListItem","position":4,"name":"Angular.js Form Validation Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/f622d6017801d9aa8131e1ae69bbdd0d","name":"Thodoris Bais","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dc31ee119255c1e4aa4a4f34858284d907cce53d033584d86b0e3de46db7d0ff?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc31ee119255c1e4aa4a4f34858284d907cce53d033584d86b0e3de46db7d0ff?s=96&d=mm&r=g","caption":"Thodoris Bais"},"description":"Thodoris is an Oracle Certified Associate Java Programmer and currently works as a Junior Software Developer, for Intrasoft International S.A. He holds a diploma at Informatics &amp; Telecommunications Engineering and is interested in continuous development.","sameAs":["http:\/\/thodorisbais.blogspot.com","https:\/\/www.facebook.com\/toubou.techblog\/","https:\/\/instagram.com\/thodoris.bais\/","https:\/\/www.linkedin.com\/pub\/thodoris-bais\/69\/6b7\/408","https:\/\/x.com\/@ThodorisBais"],"url":"https:\/\/www.webcodegeeks.com\/author\/thodoris-bais\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/2647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=2647"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/2647\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/909"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=2647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=2647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=2647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}