Hope I am not missing something very obvious but where is
ng-class="{ error: myForm.salt.$invalid }"
Something like:
<form class="navbar-form navbar-right" name="search" ng-submit="Search()">
<div class="input-group"* ng-class="{ error:
search.searchbox.$invalid }"*>
<input name="searchbox" type="search"
class="form-control" placeholder="Enter the numbers"
ng-model="model.number" ng-minlength=1 ng-maxlength=16 required>
<span class="input-group-addon glyphicon
glyphicon-search" ng-click="Search()" ng-style="{ 'cursor': 'pointer' }" />
</div>
</form>
Check this <http://www.ng-newsletter.com/posts/validations.html> out for
more details
On Thu, Feb 6, 2014 at 2:29 PM, Varun Krishna Parthasarathy <
[email protected]> wrote:
> Hi everyone,
> I am trying to validate search box that is available in my web app. The
> scenarios are something like this
>
> 1. The search keyword should be a number and its length should be 16
> digits
> 2. if the user *types more than 16 digits* the search box''s *outline
> should change to red color.*
>
> *<form class="navbar-form navbar-right" name="search"
> ng-submit="Search()">*
>
> * <div class="input-group"> *
>
> * <input type="search" class="form-control"
> placeholder="Enter the numbers" ng-model="model.number" ng-minlength=16
> ng-maxlength=16 required>*
>
> * <span class="input-group-addon glyphicon
> glyphicon-search" ng-click="Search()" ng-style="{ 'cursor': 'pointer' }" />*
>
> * </div>*
>
> * </form>*
>
> So I had followed this example <http://plnkr.co/edit/RihsxA>. But it is
> not working in my web application. Can anyone please suggest me a solution
> for this?
>
>
>
>
>
>
> Thanks,
> Varun Krishna. P
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
Regards,
Aadithya C Udupa
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.