Form validation using core AngularJS - S01 EP05 - How to submit and validate a form in Angular JS

preview_player
Показать описание

Form validation using core AngularJS - S01 EP05 - How to submit and validate a form in Angular JS

After this lesson you will know how to perform client side validation using core angularjs components.

You will learn how the built in angular variables associated with a form to style the form and form controls according to their state (valid, pristine etc..).

You will know how to add classes dynamically to elements using the ng-class directive and you will lean how to dynamically show or hide elements using the ng-show/ng-hide directives.

You will also know how to show error messages to the user if the form fails validation.

DIRECTIVES: ng-class, ng-show, ng-hide
Рекомендации по теме
Комментарии
Автор

Your explanation is clear and to the point, good job !

simonhk
Автор

Good demo man. Quick and informative. Thank you!

LogisRX
Автор

By the way the video uploaded was best... Keep brushing us like this... Thank you

kedarjoshi
Автор

very nice .. but what is that file main.js?

gajanangogurwar
Автор

greate video but prestine has a problem with checkbox and radio buttons.
every time you press checkbox or radio button option it turns on the $prestine in every field in the form.
any idea why? i canceled the prestine for now

orz
Автор

Hi, Not sure why $prisitine isn't working, as im using the same as below, still it turns green even after single word is typed.

<form novalidate id="loginform" class="form-horizontal" role="form" name="validateSignInForm">
<!--div id="login-alert" class="alert alert-danger col-sm-12"></div-->

<div
class="input-group mb25"
ng-class="
{
&& !validateSignInForm.$pristine,
&& !validateSignInForm.$pristine
}">

<!--pre>Validation : | json}}</pre>
<pre>Form Valid :
<pre>Form Pristine :


<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input
required="required"
type="text"
class="form-control"
name="email"
placeholder="Email OR Mobile Number"
ng-model="signUpEmail" >
</div>

taskcreations
Автор

In order to show all error messages after clicking an invalid form what we have to do?

kedarjoshi
Автор

Hello I got a problem with my forum when someone try to make register it says: "Submitted form was invalid. Try again." did anybody how to fix that

CS_CS-GO