145 questions
0
votes
1
answer
1k
views
How to set Date in angular.js?
I want maxDate to be selectable as today at most, (old days should be clickable, but not tomorrow)
the day between i select as maxDay and minDay should be 365 days at most, it cant be selected more ...
0
votes
1
answer
785
views
Angularjs form validation multiple input values
I am working on Angularjs form validation for multiple input values.
Below is the issue I am facing
Let's say I entered 'Johnss', directive will validate and give error Invalid name
click on plus(+) ...
0
votes
1
answer
64
views
Validation of dynamically named input fields in AngularJS
I have an input field inside an ng-repeat, which gets a dynamic name tag, like so:
<div ng-repeat="a in b track by $index">
<div show-errors >
<label for="...
0
votes
2
answers
805
views
AngularJS form validation is not working, empty form displayed
I am trying to create a form that contains selects and inputs. Unfortunately when i added this form nothing happens when when input is filled, no action ... Below is my code:
<form name="myForm" ...
0
votes
1
answer
461
views
Is it possible to use function input to create a variable name?
Pretty sure that my title is misleading... Oh well.
So basically, I'm trying to create a game and I have a bunch of arrays with names like ItemsInG5Array, ItemsInB2Array where G5 and B2 are nodes of ...
1
vote
0
answers
50
views
Is it possible to use form attribute in angularjs for form validation?
Please think in angularjs way.
Actually my layout is different.
I have input fields inside form and also have input fields outside form, this is a special case in my product.
I know about form ...
2
votes
0
answers
600
views
Custom validation in input field for unique value
I've to use AngularJS 1.7 for a project where I have a form and have to validate an input field to be required, to have a particular pattern and to have unique values. For this I'm doing this :
...
1
vote
1
answer
125
views
scope.$eval() is undefined if both input fields have the same directive
I'm trying to validate two password input fields. Simply confirm that they are equal. (Suggest another approach if mine is way wrong)
I have implemented a directive with a simple validation that ...
0
votes
3
answers
672
views
Angularjs Form validation How can i get values inside Controller
This is my Html Part
<form name="userForm" ng-submit="submitForm()" novalidate>
<!-- NAME -->
<div class="form-group" ng-class="{ '...
0
votes
2
answers
30
views
Strange validator behaviour in AngularJS 1.5.11
Our application is still using AngularJS 1.5.11 but I've tested the included example also with version 1.7.2 and get the same results.
The problem is the strange behavior of the validateNumber ...
0
votes
1
answer
63
views
How can create validation for single control's value required from multiple control in angularjs(1.*.*)
i.e, I have four text boxes if I enter a value in any text box out of all text box, it should be allowed to submit otherwise throw an error,"Value is Required",
It is possible using angularjs ...
1
vote
1
answer
1k
views
How can I validate keyup function in AngularJS
Here I'm using web API with AngularJS here I'm trying to if my keyup function is not valid then its shows me please select another email.
public IHttpActionResult GetEailCount(string email)
{...
1
vote
0
answers
549
views
AngularJS - Validate when ng-model value not in Select options
I have a situation where the ng-model value may sometimes not be present in the ng-options list of a Select dropdown (ID of a user that is no longer with the company saved in a record, for example). ...
0
votes
1
answer
62
views
javascript Angularjs validation not showing
I am using ex6 and angularjs and I write an angularjs validation form.
the HTML doesn't show up. it's not showing any errors.
The HTML of the validation :
<form id="form" name="login.sign" class=...
2
votes
2
answers
123
views
Angular JS form validation in "myApp" application.
I am new to AngularJS and try to implement form validation in "myApp" app.
I wrote the code below. The {{result}} should output "true"/"false". But it didn't work.
<script src="https://ajax....
0
votes
1
answer
2k
views
ng-show Not Showing When input is invalid
I am having trouble with form validation in AngularJS. I am trying to show a div based on whether an input is invalid. Angular is putting the correct classes on my inputs (ng-touched and ng-invalid) ...
-1
votes
3
answers
447
views
Angular JS form validation not working even the other forms work ok
i'm working on a school project. My project has some forms that need to be validated. Login and register form validation work well but the other form used to upload item is not validated. I have tried ...
2
votes
1
answer
10k
views
TypeError: Cannot read property '$dirty' of undefined
I have an Angular form with name p24Form
<div ng-form="private2" name="p24Form" ng-show="freqSelect == '2.4'" novalidate="" class="ng-pristine ng-valid">
<div class="form-group">
...
0
votes
1
answer
681
views
Angular JS dropdown list select "Others" option and Others input become mandatory
I am trying to add a dropdown list with "Others" option. If user select "Others", Others (Please specify) input box will become Mandatory. How should I validate this case? Right now I added Javascirpt ...
1
vote
1
answer
604
views
AngularJS Validate a json like an input
I have a form with an input that is "required". This is perfect when your value is just a text.
I also have a directive that outputs a json string. I want also to validate this json before submitting ...
0
votes
4
answers
4k
views
Angular validation on submit
I am trying to create a form that, if you do not fill out any of the fields, will show an alert message if you hit submit. I am trying to work with angular validation to make this happen; however, it ...
0
votes
1
answer
277
views
Using element.bind in validation directive
I trying to validate input with custom directive:
.directive('customValidation', function () {
return {
require: 'ngModel',
link: function (scope, element, attr, ...
0
votes
3
answers
1k
views
ng-show is not working for one of the similar input fields
I have a multistep form. I have ng-show which depends whether or not the input[type="text"] is empty.
Now, it works for one section of the form, but doesn't work for another section of the form.
<...
0
votes
1
answer
46
views
Custom validation implementation for Check box rendering in table format
I have a requirement in which I have to display check box in a row (Tabular way of displaying). I could not use the default checkbox implementation which Ionic provides due to some issue while ...
0
votes
0
answers
48
views
Checkbox valiadtion using Angular Js
I am using Angular js, in which i have a textbox and collection of checkbox. I want to check if atleast one checkbox is checked when the submit button is clicked. Below is the existing code:
<form ...
0
votes
1
answer
1k
views
Validate controls within ng-repeat: textbox and textarea
I am using Angular js, in which i have a textbox outside and an ng-repeat containing textbox and textarea. I want to check if the fields contain value when submit button is clicked. I am able to ...
1
vote
0
answers
597
views
Validation using AngularJs on button click event
I have a AngularJs form which contains textbox,textarea,dropdown,checkbox, date, time controls, ng-repeat textbox and textarea controls. I want to validate these controls only on submit button click ...
1
vote
2
answers
2k
views
How to use ng-required with $touched?
I try to set an input as required if another input has changed. My need is to require confirm password if password has changed.
I use this on the input of confirm password but it is never required :
...
2
votes
2
answers
4k
views
"Required" validation doesn't work in <select> with default value
I have a required <select> field:
<select name="service_id" class="Sitedropdown" style="width: 220px;"
ng-model="ServiceID"
ng-options="service.ServiceID as service....
0
votes
1
answer
989
views
Angular Form Validation using Ng Model
Question: How can I show the validation error using only the ng-model if I cannot name the form and its elements.
I have a html form to collect credit card details. To prevent the credit card data ...
0
votes
1
answer
1k
views
Angular directive change ngmodel value from null to undefined breaks validation
I have created a plnkr to describe my problem: Link to plnkr
Problem description:
I have a number field, the value from which is written to the model. First I implemented this feature like the first ...
0
votes
0
answers
38
views
has-class not getting applied through ng-repeat form validation : angularjs
<div class="col-md-12" data-ng-repeat="p in ['A1','A2','A3']">
<div class="form-group col-md-6"
data-ng-class='{ "has-focus": form.model[p].hasFocus,
"has-success": form....
0
votes
1
answer
112
views
$error.required message is not getting reset on reset button : AngularJs
<div class="form-group">
<input type="text" name="Name"
data-ng-model="panNumber" required>
<p data-ng-show="loginForm.Name.$error.required && (loginForm.Name.$touched ...
4
votes
1
answer
23k
views
Date validation in AngularJS
I cannot allow future date in my form built in angularjs
Here is my HTML:
<div ngCloak ng-app="laurelMoney" ng-controller="myCtrl">
<form name="userForm">
<div class="form-group"...
4
votes
2
answers
4k
views
Cannot read property '$valid' of undefined if form is inside a div with ng-if condition
I have a form inside a div with ng-if condition. Initially form is closed. On click a button, form is displayed. But on submitting form, I'm getting Cannot read property '$valid' of undefined error. ...
1
vote
2
answers
976
views
Angular: force custom form validator to run on any field input
I've written a custom validator for a password field, in order to verify the following scenarios:
if user has id defined, then password is always valid (can be empty, meaning no change)
if user does ...
1
vote
2
answers
599
views
angularjs form validation that has an internal form
I have a form by some input. and some time I have another form by some input into this form.
when I have not internal form, my parent form is valid, but when I have internal in original form and ...
0
votes
1
answer
3k
views
Angular JS Validation - How to turn off required for a single field
I'm trying to turn off the required attribute for a single input field in an Angular form on submit, if a certain condition is not met. I have tried the following:
form.ChangeCreditCard.$setValidity("...
3
votes
1
answer
2k
views
Angular Form Validation: $error.required set even when ng-required=false with custom input directive
I have Custom input component with validation with ngMessages,FormController and ng-required:
<div class="col-sm-9 col-xs-12">
<input
id="{{$ctrl.fieldName}}"
name="{{$ctrl....
4
votes
1
answer
586
views
AngularJS form validation ngMessages not working with multi-step form
I am using AngularJS 1.5, ui-router for state management and ngMessages for validation and ngMaterial for UI. I have one main view contained in myformView.html and I load inside it two states (...
3
votes
0
answers
553
views
Validate dynamically created Check box and Radio buttons
I have an application in which dynamically check boxes and radio buttons get generated based on the data sent from the server. The number of check box/radio button displayed can increase up to 20 (in ...
0
votes
1
answer
107
views
validate certain fields of a form depending upon type of user logged in
i have a form which contain 10 fields, if user type 1 is logged in only one field should be validated else all the fields should be validated.is it possible to validate certain fields depending upon ...
0
votes
1
answer
99
views
Input validation: Validation message and ng-disabled buttons not working as expected
I have the following code which I'm trying to validate using AngularJS:
<div ng-form="transWizard" novalidate>
<div style="word-wrap:break-word; padding-top:4px; padding-left:14px">
...
0
votes
1
answer
1k
views
Invalidate form if disabled select option is chosen
Is there a way to invalidate a form if value="0" in my select tag is chosen? The reason I did this is to have a default select option show up before a user see's anything.
But even if a user doesn't ...
1
vote
1
answer
2k
views
How to enable AngularJS validation for button that is outside of form?
I am new to angular, I was struck to trigger a form validation with the button outside the form. I have two buttons one inside form, which works and one outside, I want the outside button to do the ...
1
vote
3
answers
3k
views
How to manually change the $error values for input tags - Angularjs
I am submitting a form via the angular $http and I want to give an error if the user bypassed the angularjs validation. I want to use the same error tag as if they didn't bypass the validation, ...
4
votes
2
answers
1k
views
AngularJS form input name validation not working in ngrepeat
name="number-{{$index+1}}" working in ng-repeat at the same time myform.number-{{$index+1}}.$invalid does not working for the form
Demo: http://plnkr.co/edit/Z3EmpHu8w2iZcZko9dJv?p=preview
var ...
0
votes
1
answer
1k
views
Issue in JQuery Validation with AngularJS
I use ruby on rails and Angular.
I follow - https://github.com/jpkleemans/angular-validate
I do following
APPLICATION.JS
//= require jquery
//= require app/jquery.validate.min.js
//= require ...
0
votes
1
answer
952
views
angularjs single input filed for both email and mobile number
In the registration form i have single field for both email and mobile number but it doesn't working properly.
<form name="regForm" >
<md-input-container flex md-no-float>
<...
-1
votes
1
answer
573
views
How to perform dropdown control validation with angular js validator?
I am doing angular js dropdown validation but getting problem when doing dropdown validation.
I have taken everything from this website and using this code:
https://github.com/turinggroup/angular-...