Solved

validation using angularjs

Posted on 2014-02-04
2
303 Views
Last Modified: 2014-02-05
Hi Experts,

I have to validate a number field with following criteria using custom directive in angularjs  and here is a working code  custom directive for numeric only for the below criteria (a) and need  to satisfy other two criteria's (b & C) using custom directive.

a)should not allow alphabets or special characters
b)should not start with Zero
c)maximum numbers allowed is 9

Valid Entries: 11111,123,100000000,1 etc

Invalid Entries:0111(started with zero),1234567891(10 digits) etc

I need help to satisfy other 2 conditions in angularjs
0
Comment
Question by:ksd123
2 Comments
 
LVL 23

Accepted Solution

by:
Ioannis Paraskevopoulos earned 500 total points
ID: 39835051
Sorry, i do not know how to do it with regex, but you may try the following:

http://jsfiddle.net/4HRJu/

Giannis
0
 

Author Closing Comment

by:ksd123
ID: 39835268
Thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now