Solved

validation using angularjs

Posted on 2014-02-04
2
309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
arrays and buttons with user input 2 34
javascript and jquery question 4 26
w3c parsing errors 4 20
Problem in javascript 17 29
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

726 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