Questions tagged [ng-pattern]

HTML input element control with angular data-binding. Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.

HTML input element control with angular data-binding. Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.

Source: http://docs.angularjs.org/api/ng/directive/input

170 questions
0
votes
2 answers

Force ngPattern validation when another input is changed

I have an Angular JS application in which there is a required phone number field, as well as a country select field. The country select defaults to United States. When the selected country is United States or Canada, I want to validate the phone…
Andrew Mairose
  • 10,615
  • 12
  • 60
  • 102
0
votes
0 answers

AngularJS ng-pattern regular expression

I have the following input field that accepts the price as a value. input{ type="text" name="price" np-currency=true ng-model='price' ng-pattern="/[$,.]\d*$/" } This pattern("/[$,.]\d*$/") makes the input field invalid for…
Ramya
  • 107
  • 1
  • 1
  • 12
0
votes
1 answer

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.45.3/8, 172.53.23.12 Can someone help me on this.
0
votes
2 answers

how to check input numeric value against value previous saved and show error message if it is not the same value

note: total is number value that update dynamically according to user input
Kero
  • 1,924
  • 5
  • 33
  • 53
0
votes
2 answers

Can not Allow the decimal value inside input field using Angular.js

I need one help.I have a input field validation and this field only accepts the number including decimal value also using Angular.js pattern.I am explaining my code below.
satya
  • 3,508
  • 11
  • 50
  • 130
0
votes
1 answer

ng-pattern not working with text-angular div

I have used text-angular for getting input from user. The below code does not validate the input
Chetan Gawai
  • 2,361
  • 1
  • 25
  • 36
0
votes
1 answer

ng-pattern to dissallow email, url and telephone numbers

Hi I want to validate a textangular box which will have a lot of text, but I don't want to allow telephone numbers, email ids or any URLs in this text box. I want to show the error message as the email/telephone/url if mentioned in the text box as…
aksit
  • 69
  • 1
  • 6
0
votes
1 answer

How to pass a regex from a directive to an input AngularJs

i have this directive angular.module('tutors.components') .directive('formValidator', function() { return { restrict: 'A' link: function (scope, element, attrs) { function nameValidator (input) { var regExp…
0
votes
1 answer

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:
{{ x.number }}
More specifically, the ng…
0
votes
3 answers

Regex for relative filepath maximum size and maximum Folder name size

Linux has a maximum filename length of 255 characters for most filesystems, and a maximum path of 4096 characters. If the foldername is longer than 255 it cannot be created. /^[a-z0-9\s_@-/.]+$/i is a good regex (I need special characters in the…
Dezso Gabos
  • 2,297
  • 5
  • 21
  • 29
0
votes
1 answer

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.
field1Value =…
Saidh
  • 1,131
  • 1
  • 12
  • 21
0
votes
0 answers

ngPattern rejecting all inputs, inside ngForm

I have a ngRepeat populating a form but form.input.$error.pattern is true (the input does not match the RegExp) with anything in the text input for the first input. For all inputs after that form.input.$error.required stays true, even with something…
ninjabugs
  • 103
  • 7
0
votes
2 answers

Angular phone pattern validation

is any way to validate phone number in two forms? I would like to validate numbers beginning with "+" and phone without "+". For example, it should pass numbers +238472636 and 193785626. Pattern: /^[\+]\d+$/
0
votes
1 answer

AngularJS 1.3 pattern validation binding not working

I have been using Regex pattern validation with AngularJS for the last several versions and it has worked fine. My application requires that validation patterns are exposed by a scope property, to which the corresponding AngularJS validation…
Tim Coulter
  • 8,705
  • 11
  • 64
  • 95
0
votes
1 answer

Different ng-pattern Behaviors

Scenario I'm using ng-pattern in a project where I need to dynamically generate regular expressions via string concatenation meaning the end result is var regexp = "regexp" rather than var regexp = /regexp/. The Problem I know that this code…
jpodwys
  • 393
  • 2
  • 11