Solved

validation using angularjs

Posted on 2014-02-04
2
305 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

809 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