Questions tagged [angularjs-forms]

AngularJS Core `

` Directive

Resources

133 questions
153
votes
9 answers

Can I access a form in the controller?

I'm currently using the following. $scope.$$childHead.customerForm[firstName], so that:
Vincent
  • 6,058
  • 15
  • 52
  • 94
81
votes
3 answers

Using $setValidity inside a Controller

I am trying to do some validation on file change. Here is my code: View/Template
Churk
  • 4,556
  • 5
  • 22
  • 37
18
votes
4 answers

`ng-pattern` - how to check for only numbers?

I am using an ng-pattern to check for ONLY numbers in my input. But for me that's not working. I can able to type in characters after the number. How can I restrict that? here is my code :
user2024080
  • 1
  • 14
  • 56
  • 96
15
votes
1 answer

ng-pattern doesn't show $error.pattern

I have script here and ng-pattern works correctly because scope.subnet is shown in Output only after input matches pattern. But ng-show doesn't display any error if ng-pattern is not matched
irom
  • 3,316
  • 14
  • 54
  • 86
8
votes
1 answer

Angular form is $valid when all inputs are blank, why?

My form is showing up as valid even though all of my input fields are blank. I have the required keyword in the input fields.
ErikAGriffin
  • 739
  • 3
  • 10
  • 21
7
votes
1 answer

Angular form not working in a table

I created a working form placed in a div below a table;
Morten Nilsen
  • 621
  • 7
  • 18
6
votes
2 answers

How to get file content and other details in AngularJS

How can I get file content while I click on submit button. I'm getting only first and second input. Please refer to snippet: !DOCTYPE html>
Mohammed
  • 648
  • 2
  • 12
  • 32
5
votes
3 answers

AngularJS - Prevent submission of a form if it is invalid

I have created an isolated case of my issue: http://plnkr.co/edit/6LXW5TG76LC9LNSrdpQC Here is the code of the isolated case:
rwacarter
  • 1,915
  • 1
  • 14
  • 25
4
votes
2 answers

How to stop form submission in AngularJS

You may be amazed why I am intended to do it, but it's necessary to be done. I couldn't solve, so could you please help me.. if yes, let's go! I have a form, I want that if I click on submit, an action/event should be generated that stops the form…
Sikandar Sahab
  • 638
  • 3
  • 10
  • 27
4
votes
1 answer

Angularjs form $error is not getting updated when the model is updated inside a directive unless the model be cleared

I can't figure out what's happening in the following example. I just trying to create my own required validation in my own directive where I have an array and I want to make it required (it's a simplification of what I want to do but enough to show…
4
votes
1 answer

Angular ng-required not working with custom directive

I am using Angularjs version 1.5 to validate the inputs in my form. ng-required is used to validate the all input required However, its not working with a custom directive which renders a combo. The combo retrieves the items based on parameter…
4
votes
3 answers

Simple submit form using Angular

I'm new to Angular, but very old with google. I cannot find out how to submit this form using Angular, like how we do in jQuery.
Basit
  • 16,316
  • 31
  • 93
  • 154
4
votes
2 answers

Prevent async unique validator to validate same value only when editing?

I've got an AngularJS form that has a custom validator to check with the server backend whether the input value is unique or not. The unique validation is done by the mob-async-validate-unique directive in the example below. The form looks somewhat…
4
votes
1 answer

ng-required not working when submitting a form

I have the following code in an input text box with the required attribute, but when I tab off of the field or submit the form, it doesn't stop the form from submitting and informing the user the field is required.
sagesky36
  • 4,542
  • 19
  • 82
  • 130
1
2 3
8 9