Comments (3)
Sorry but I'm not going to parse the value of ngRequire
and not validate if it's false. If you can explain your use case in a little more detail I'm happy to help you with a more direct solution.
from angular-credit-cards.
It seems that your module should support the native validation capabilities in Angular. Its odd that if the code is specifically saying, "Don't validate this input" via ng-required="false", that the module is validating anyway.
In my scenario, we only need to validate the credit card field when entering a new card. When editing an existing card, we only send the last 4 digits of the card to the client. Pretty standard.
The same form is used for both creating and editing card data (name, address, number, cvv, etc). When editing an existing card, the number input is not shown and a span is visible with the 'xxxx-xxxx-xxxx-1234' style for the number. This is the situation where your module should respect ng-required="false" because the input is in the form, but is not being used for this interaction. However, your module is still trying to validate a control when its being instructed not to.
from angular-credit-cards.
Hello, here's another case where this would be appreciated.
In my form, the user can checkout 2 ways.
- Using the checkout with Paypal button
- Entering his credit card information and sending it to Stripe.
The form consists of two radio buttons. Paypal hides the credit card form while the other one shows it.
No matter if the credit card is visible or not, the form is never validated because it's expecting a credit card number, expiration date and CVC.
Normally, I would simply set ng-required="isPaidByCreditCard" to ask for validation. In the case of angular-credit-card, this does not work.
Do you know an alternative? Create / remove the credit card form when needed instead of hiding / showing it?
Thank you for your time.
UPDATE: I managed to get it working by adding ng-form around the credit card form and then bypassing it's validation if Paypay button was selected.
from angular-credit-cards.
Related Issues (20)
- Test card numbers showing wrong card type HOT 1
- Is there an exmample of cc-format markup? HOT 3
- cc-exp-month and cc-exp-year set incorrect validity keys HOT 6
- NgModel value is not updated HOT 1
- How can I use this in Angular4? HOT 1
- cc-number validation message when field is required HOT 2
- cc-exp and required message HOT 2
- [FIX] Temporary fix for ngRequired directive case HOT 3
- ng-model-options ignored? HOT 1
- Issue - CC input in google chrome Android Mobile HOT 3
- Problem with validating DISCOVER cards HOT 1
- Angular import overwrites angular global with webpack HOT 3
- Transposes numbers while typing HOT 5
- Angular 4? HOT 2
- Discover card is interpreted as Maestro HOT 1
- Wanna parse exp month as string. how?! HOT 1
- Transposed Numbers HOT 2
- Action required: Greenkeeper could not be activated 🚨
- Test Card Number 6011 1111 1111 1117 Incorrectly Identified HOT 2
- Can this work with angular > 1.7 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-credit-cards.