An optional directive that can be used to check values for input: Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.

learn more… | top users | synonyms

2
votes
0answers
15 views

angularjs ng-pattern change css style of elements based on regex condition

In my angularjs form, I am checking the password pattern with a regex that checks for multiple conditions. Based on different condition checks of this regex, I want to change the css for one of the ...
0
votes
1answer
14 views

How to debug ng-pattern

I'm working on custom form validation for an Angular application using ng-pattern. In my form I have: <form name="jobsForm" id="jobs-form"> <div jobs-form jobs="jobs"> <...
-4
votes
0answers
18 views

Angular ng-pattern for decimal value or int value greater than 0

I am trying to allow all decimal or integer values greater than 0 using ng-pattern. Like 1.23 - Ok ,0.25 - Ok but simply 0 is not allowed. I tried this , /^[1-9]\d{0,2}.?[0-9]*$/ but it gives me ...
1
vote
3answers
49 views

How to allow only 3 digit and one dot in Regular Expression

I want to do like this : 3.40 and not more than 3 characters and one dot: <md-input-container class="md-block"> <label>Marks/CGPA</label> <...
0
votes
3answers
46 views

How to edit input style by using ng-pattern

I made a small js here I also add the code to the Stack overflow snippet but for some reason it doesn't work to me var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $...
0
votes
2answers
73 views

AngularJS with ng-pattern in form does not send invalid field to server

I want to validate a text input in form, so the submit of the form could not be done until the input match a regular expression. But when I type a wrong field value and I clik submit the form is ...
0
votes
1answer
45 views

How to validate value 1 and 1.00 as same and 1.01 as different in angular

How to treat 1 and the number of decimals should be zero eg) 1.000 as same show the alert pop up number should be same.And the maximum number length of the texbox is 7. eg)1 and 1.00000001 be ...
0
votes
1answer
44 views

Regex digits with length and some specific characters

I have a phone number input field where it must: Allows spaces and "-" and "+" characters. Have 12 characters max including the special characters (ex +12345678910). I tried but my best result was ...
-1
votes
2answers
125 views

Regular Expression for ng-pattern

I want my input text to accept following characters only 1,2,3,4 and 5+ And to validate the above character I need a regular expression (ng-pattern). Is their any perfect website to learn Regular ...
0
votes
2answers
120 views

regex for multiple IPs comma separated with or without subnet

I have regex for IPv4 address: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ and i have regex for IPv4 CIDR range : ^(([0-9]|[1-9][0-...
-2
votes
1answer
16 views

Match an expression with no << or ]] [duplicate]

I need to match the pattern only if << or >> or ]] or [[ is not present in the string. If any of these special characters are present the match should be zero else it should match. For ...
0
votes
1answer
116 views

Restricting few special characters like %,& and " in input field by ng-pattern

I have a password where It should be minimum 8 character with alpha numeric and symbol except &,",% .I given ng-pattern and restricted few symbols. but when I type & too it is accepting. This ...
0
votes
2answers
44 views

Regex acts weird

I want to create a regex expression that I can pass to ng-pattern so that the input can only be valid if the string has only uppercase/lowercase latin letters from a to z, n with tilde, and vowels ...
0
votes
2answers
334 views

Conditional ngPattern

Following this bit of code: <label class="checkbox-label"> <input name="radio1" type="radio" ng-model="myModel.radio" required ng-required="true" ...
-1
votes
1answer
35 views

Regular Expression Generation for AngularJS ng-pattern

I'm using a regex to validate a form input. So basically a user can input "SELECT some_name of select_match". So far I have the regex: \bSELECT\b \bof select_match\b The last part is the middle part, ...
1
vote
1answer
52 views

AngularJS ng-pattern validator mobile [closed]

I want to use ng-pattern to my input text like this form 0XXX XX XX XX help me please. and thanks for everyone
4
votes
2answers
89 views

Angularjs regular expression

In my Angularjs application I need to have regular expression for two patterns for form validation with the following condition. Pattern 1 : The input box should accept alphanumeric with no space ...
1
vote
1answer
125 views

ng-pattern for only hebrew characters

I want to use ng-pattern validate my text input field that should accept only Hebrew characters, sometimes the input are ok and sometimes they are being rejected for some reason. (the first one is ...
2
votes
2answers
139 views

Regular expression : match either of two conditions?

Hi I don't know much about regular expression. But I need it in form validation using angularJs. Below is the requirement The input box should accept only if either (1) first 2 letters alpha + 6 ...
0
votes
0answers
156 views

angularjs ng pattern validation

I'm facing an issue with a regex using Angular JS ng-pattern. I wrote the following regex for input validation that validate the number input like Numerator and Denominator: <div class="form-group"...
1
vote
2answers
383 views

Australian Mobile number regular expression validation needs to allow space in between number

I need to validate the mobile number first text input starting with 04 should be total 10 digits including 04(eg : 0412345678) my input field is below <form name="uploadForm"> <input type=...
0
votes
2answers
167 views

ng-pattern allows '+' character when regex limits to digits

Am using the regex /^[0-9]+$/ to limit the input of the text box to only accept numbers. It's working fine but when the types something like +124 then also it's not setting the text box as invalid. &...
0
votes
2answers
1k views

How to use ngPattern to validate an input containing restricted characters?

I try to validate the input of restricted characters. The input field only accept alphabet, dash and underscore characters. When I test the code below, the first character is accepted, but the second ...
1
vote
1answer
107 views

ng-pattern (regex) to validate drive letters

I'm having little hard time with a regular expression. Any help would be greatly appreciated. Problem: I want display an error when user enters drive letters in the path. for example: if user enters ...
0
votes
0answers
101 views

Adding ng-pattern dyanmically through a directive isn't kicking off validation

I'm attempting to add ng-pattern to specific inputs on specific forms using the following directive. It's adding the ng-pattern, but the validation isn't working. However, the validation works fine ...
0
votes
1answer
1k views

How to use ng-pattern to limit 10 number inputs separated by commas

I want to enter in up to 10, 8 character length numbers in one text field all separated by commas. For example, 12345678,12345678,12345678,12345678..... The only thing is the numbers can only be 8 ...
0
votes
0answers
23 views

ng-pattern not accepting '@' special character in validation [duplicate]

NET MVC, HTML 5 and Angularjs, i am having trouble on using ng-pattern in the password field validation. this is my pattern ng-pattern="/^(?=.*[0-9])(?=.*[!#$%^&*])[a-z0-9!#$%^&*]{8,16}$/" I ...
2
votes
1answer
1k views

ng-pattern regex Error: [$parse:lexerr] Lexer Error

I have this as my regex pattern (^([Aa][Ss])[0-9]{8})|(^6[0-9]{7}) i get console errors below, but it works!: libraries-c8d65edf41.js:22505 Error: [$parse:lexerr] Lexer Error: Unexpected next ...
7
votes
2answers
6k views

How to add password validation using regular expression in angularjs according to certain criterion?

I want to validate password entered by user for following criteria : Password should be at least 8 characters long and should contain one number,one character and one special character. For it I ...
0
votes
1answer
349 views

Text input validation using ng-pattern in AngularJS

I want to validate a text input with ng-pattern directory in AngularJs. The text input can have multiple IP addresses and IP ranges with , (comma) separated. for an example; 172.168.21.3, 172.168....
1
vote
2answers
76 views

looking for a regular expression to match specific decimal format in ng-pattern

i am looking for a regular expression to put in ng-pattern attribute of angular. i am looking for an expression that satisfies only a specific decimal pattern i.e. exactly one digit --> than a ...
-1
votes
1answer
312 views

validation for email and mobile no in single inputbox using angularjs

How can I validate emailid and mobile no both in a single input box in AngulaJS? I'm trying to validate emaild and mobile no in same input box. it is working fine seperately, but for both emaild ...
3
votes
2answers
605 views

ng-pattern should not match supplied pattern

In ng-pattern we have the option of specifying that the field should match a specific pattern. How can we specify that it should NOT match the specified pattern? Example, <input type="text" ng-...
2
votes
2answers
325 views

regex for ng-pattern for filepath

I have arrived at a regex for file path that has these conditions, Must match regex ^(\\\\[^\\]+\\[^\\]+|https?://[^/]+), so either something like \server\share (optionally followed by one or more "\...
3
votes
2answers
3k views

ng-pattern with regex having double quotes does not escape correctly

I have a ng-pattern validation for a regex of ^[^\./:*\?\"<>\|]{1}[^\/:*\?\"<>\|]{0,254}$ which basically tests the invalid chars in filepath and teh limit. but when i have the ng-pattern ...
0
votes
1answer
290 views

Is ng-pattern possible on contenteditable elements?

Can't seem to find any info on this. Is it possible to use ng-pattern on a contenteditable div? When I try it doesn't work: <div contenteditable="true" ng-model="x.number" ng-pattern='/^(\d)+$/'&...
0
votes
2answers
597 views

ng-pattern issue with input type number

I am facing one weird issue when trying to use ng-pattern with input type number. <input type="number" name="input" min="0" max="1000" data-ng-model="input" ng-pattern="/^[0-9]*$/"> <div ...
0
votes
1answer
125 views

ngPattern is not working after upgrading Angular JS 1.2.x to 1.4.x

The pattern validation using angular ngPattern is not working after upgrading the Angular JS library to 1.4.1. See the code below. <form class="form-horizontal" name="someForm" role="form" ...
1
vote
1answer
343 views

ng-pattern not working inside directive

I'm trying to wrap an <input> in a directive so that I can handle date validation and convert it from a string to an actual Date object and maintain the Date version in the original scope. This ...
1
vote
3answers
753 views

Smaller Work around for ng-pattern on Select

I am working on an angular app and I needed to put a pattern validation on a select element. Just using ng-pattern on select didn't work. So I created a hidden input with same model with ng-pattern on ...
-1
votes
1answer
599 views

ng-pattern not matching the correct regex

I am using a form to get user details. In my name input I want only alphabetic characters, spaces and apostrophe. So I created the form input like <input placeholder="FULL NAME" type="text" ng-...
3
votes
2answers
889 views

Require two words in textbox, with AngularJS

I really struggling with this. I need to force the user to write the first and last name, in only one textbox. I using AngularJS, and I want to validate text field using ng-pattern. The field should ...