50 questions
0
votes
0
answers
82
views
Angular js form validation without html form
I have an input tag
<div class="form-group" ng-form name="patientLinkingForm">
<input type=&...
1
vote
0
answers
48
views
ng-pattern does not work when pattern set dynamically in ng-repeat
I have some sets of patterns in my controller. I am trying to set this pattern dynamically for ng-pattern using ng-repeat.
Pattern example :
$scope.codePattern = (function () {
var regexp = /^([a-zA-...
0
votes
0
answers
71
views
Custom Angular Validation based on a selection radio select button
I need some help in that i have validation working partially. When one selects a payment method called CC the user input needs validation to kick in instantly and wont allow one to input the wrong ...
0
votes
1
answer
425
views
AngularJS - ng-pattern on a form failing for certain special symbols such as the dollar sign
I am writing an app with AngularJS 1.5. I am trying to write a feature where the user can verify their password in the app and I am using ng-messages to try to validate the form.
My from has 2 fields:...
0
votes
1
answer
107
views
Angular js allow alphabetical caharacters and special characters but not numbers
My directive is below. What i want is that to allow alphabetical caharacters and special characters but not numbers. How can we changed that based on my code below.Thank you.
app.directive('...
0
votes
0
answers
77
views
Ng-Pattern performance issue with multiline regex
I have performance problems with ng-pattern on a textarea input.
I have a Regex expression to simply check if the code contains script, image or iframe tag. If I paste a script with multiple lines, ...
0
votes
0
answers
191
views
ngPattern problem with dynamic forms inside ngRepeat
I've been stuck on a problem for a while now and I feel I've exhausted all efforts.
I have a dynamic form created using an ng-repeat, for some reason ng-pattern will not work in this scenario, ng-...
1
vote
1
answer
50
views
spicy angularjs regex
I've been working on a regex problem for angularJs ng-pattern which needs:
Cannot be blanks
A minimum of 1 character and a maximum of 32 characters
Spaces ONLY are not allowed
Acceptable special ...
0
votes
1
answer
719
views
Angular js Ng-pattern does not allow update the model
i have to validate the text box which shows the error message when user enters 4 digit as 9999.so i have used the ng-pattern method to show error message but ng-pattern does n't allow to update the ...
1
vote
2
answers
728
views
ng-pattern to check amount should be of 1 to 3 digit with 2 decimal value (999.99)?
I am working on a transaction form. In the form, there is a field name Amount. I am using this ng-pattern i.e. ng-pattern="/^[1-9][0-9]{0,2}(?:,?[0-9]{3}){0,3}(?:\.[0-9]{1,2})?$/" which allow only ...
1
vote
1
answer
727
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
1
answer
911
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">
<...
0
votes
3
answers
3k
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
3
answers
933
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
2
answers
2k
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 ...
1
vote
1
answer
264
views
Angularjs allow one decimal number with after
<input type="number"
name="content"
md-auto-focus
ng-model="vm.model.content"
ng-required=...
0
votes
1
answer
832
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
1
answer
2k
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 ng-...
-1
votes
2
answers
400
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
2
answers
4k
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-9]|...
-2
votes
1
answer
24
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
1
answer
3k
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
2
answers
103
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 ...
-1
votes
2
answers
1k
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
1
answer
74
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, ...
4
votes
2
answers
195
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 ...
2
votes
1
answer
2k
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 ...
5
votes
2
answers
38k
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 ...
4
votes
2
answers
10k
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
2
answers
440
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
2
answers
4k
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
1
answer
684
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
0
answers
200
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
1
answer
3k
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
0
answers
38
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
1
answer
2k
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 ...
12
votes
4
answers
36k
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
1
answer
703
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
2
answers
590
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
1
answer
495
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 ...
5
votes
2
answers
3k
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
3
answers
1k
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 "\...
4
votes
3
answers
8k
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
1
answer
875
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)+$/'&...
1
vote
2
answers
1k
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
1
answer
149
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
1
answer
639
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
3
answers
2k
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
1
answer
1k
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
2
answers
3k
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 ...