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

ng-pattern passwords match

hi am creating a register form and I want to check using angular if the passwords that the user has entered match. All my validations work (required, min & max length) but i always get the error that the passwords do not match. My code is as…
Andreas Traganidas
  • 497
  • 1
  • 6
  • 13
1
vote
1 answer

Angular ng-pattern: textarea format regex

I want to control form of user input in textarea on my page. The input has to look exactly like this: That means only three values in one row and semicolon between the first and the second and between the second and the third value. By now I am…
witcher
  • 135
  • 2
  • 13
1
vote
1 answer

regex pattern repetition and ng-invalid

I have this pattern like so The last part {4,5} is at least 4 and no more than 5.…
Garuuk
  • 2,153
  • 6
  • 30
  • 59
1
vote
1 answer

AngularJS textarea ng-pattern with multiple matches

I'm trying to have a textarea which contains a list of emails validated with ng-pattern, combined with ng-list. I've tested my Regex in various testers and it seems to work correctly but not in my application. I'm not sure if the issue is Regex, or…
1
vote
1 answer

Valid looking regex pattern throws error when used with ng-pattern ?

I've found and want to use the following pattern ((ht|f)tp(s?)\:\/\/|~\/|\/)?([\w]+:\w+@)?([a-zA-Z]{1}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?((\/?\w+\/)+|\/?)(\w+\.[\w]{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)? Regular expressions 101 considers it a valid…
George Bora
  • 1,618
  • 6
  • 26
  • 45
1
vote
0 answers

Div contenteditable with ng-pattern

I looked around the internet and couldn't find a solution to this. I don't see it in the angular documentation so this may not even be possible at all. I was wondering if we can get ng-pattern and .ng-invalid-pattern working with "div"…
Kev84
  • 827
  • 3
  • 15
  • 26
1
vote
1 answer

Error in Email validation using ng-pattern in AngualurJs?

I am using following ng-pattern for validating the email "/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/" /> My code for email field is as…
1
vote
1 answer
1
vote
1 answer

Validate A-Z0-9 has maxlength 10, but allow user to enter spaces (but skip spaces in maximum)

I'm wondering if there is an easy way to set this validation on a form text field, without creating a custom directive. I need to validate that {minlength: 2, maxlength: 10}, user can enter any combination of [A-Z0-9\s], but only the amount of…
ngDeveloper
  • 1,304
  • 2
  • 16
  • 34
1
vote
1 answer

Custom notPattern directive like ngPattern, but checking whether a RegExp does not match

I am trying to write a custom AngularJS directive similar to ngPattern, except that this directive would fail validation if a RegExp does not match. Following the source of the ngPattern directive, I came up with: .directive("notPattern", function…
Daniel Trebbien
  • 38,421
  • 18
  • 121
  • 193
1
vote
2 answers

AngularJS Dynamic ng-pattern not working

I have a issue in validating the form through ng-patter. The ng-pattern validation is depend on the another drop down menu. In the drop down menu, I have two values A and B. For each value, I have different pattern to validate. Now, the problem I am…
Robindra Singha
  • 141
  • 1
  • 2
  • 12
1
vote
2 answers

leading zeros missing within number input

I need to have displayed, within the number input field, the leading zeros on integers between 00-09. I am using angularJS. View/template for the input field(sorry for the style within the html):