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
1 answer

Angular ng-pattern to allow one dot

How to allow on text input , numbers and one dot using Angular? I have this on html : But I want to allow just one dot. Any idea?
BrMe
  • 315
  • 2
  • 8
  • 22
0
votes
0 answers

ng-pattern doesn't seem to work inside directive with isolate scope

I've got a simple directive 'wrapper' for a bootstrap datepicker widget. module.exports = function () { return { restrict: 'E', scope: { dateModel: '=', srText: '@', minDate: '=', maxDate: '=', fieldName: '@', formError:…
Chris
  • 63
  • 1
  • 1
  • 8
0
votes
3 answers

Regex to validate that first letter of every word is capital in angular js

I am using angularjs. I want to use validation for my name field. I am a beginner in regex expressions. I want that the first letter of every word should be capital. For E.g Naveen Kumar should be valid and Naveen kumar is invalid. I am using…
vjangra
  • 173
  • 1
  • 5
  • 14
0
votes
2 answers

Reset angularjs form fields with wrong ng-pattern

`http://plnkr.co/edit/kAt9B3GrO8m8TT7lUHt6?p=preview` Hey friends, can you please tell me how to reset form values in less steps instead of making each and every value null? I have a pattern allowing alphabets and when I try to reset form, I want…
Ani Reddy
  • 25
  • 5
0
votes
1 answer

angular input ng-pattern sanitize regex

Can anyone recommend a regex that will reject any string with characters that should be escaped for use in an angular form input like... And yes I know…
honkskillet
  • 3,007
  • 6
  • 31
  • 47
0
votes
1 answer

AngularJs directive expression ID and ng-pattern not working

Using a form input directive with ng-pattern. It works (i.e. error is displayed) when the ID on the directive is a string, but fails (i.e. error never displayed) when the ID is an expression. Pseudo code: works
0
votes
2 answers

AngularJS ng-pattern with or within textbox

I need to limit an input box to either accept a number or a certain string pattern This does not seem to fully work, i can add 555f and this will be a valid…
Dale
  • 352
  • 2
  • 15
0
votes
1 answer

ng-pattern not validating second time

I have a multiple page (view) sign up form and on view 3 I have an input with an ng-pattern to evaualte a postal/zip code. The problem is when I switch views and then revisit the view with the ng-pattern the input becomes invalid.
user1876246
  • 1,219
  • 5
  • 18
  • 33
0
votes
1 answer

Regular expression ng-pattern angularjs

I have to validate an input field, but I have problems when the user copy and paste something inside the input This is my code
peppeocchi
  • 814
  • 1
  • 9
  • 22
0
votes
1 answer

AngularJS ng-pattern behaviour

I have a ng-pattern to enforce a particular format (for instance, IP v4 address): The data comes from the DB but…
Guillaume
  • 277
  • 5
  • 15
0
votes
1 answer

Can ng-pattern holds a condition?

What is the right approach for the below line? ng-pattern="(true)? apply-pattern : dont-apply-pattern" My Issue is, I'm hiding the ng-pattern field when its not needed, but still its not allowing the form to be valid. I tried the field to be…
shaik
  • 275
  • 2
  • 6
  • 11
-1
votes
1 answer

ng-pattern for input text

I have the following input-form-control: input.form-control( ng-model='controller.password' ng-minlength='1' ng-maxlength='8' name='password' type="{{ controller.passwordShowType }}" ng-pattern='controller.PASSWORD' …
user3045654
  • 1,634
  • 2
  • 12
  • 21
-1
votes
2 answers

Should not allow the space in password field?

Need to show error message whenever i enter space in password input field using ng-pattern.
Santhoshkumar
  • 780
  • 1
  • 16
  • 36
-1
votes
2 answers

Conditional ngPattern

Following this bit of code:
Rafael Herscovici
  • 16,558
  • 19
  • 65
  • 93
-1
votes
1 answer

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, which I think should be [a-zA-Z] but I'm not sure…
D. Gal
  • 329
  • 2
  • 14
1 2 3
11
12