question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to get raw value by default

See original GitHub issue

Hi, How can I get raw value with input.val() by default? I’m trying to use Cleave with external credit card validator and when validator gets value of input using jQuery.val() it’s failed on Cleave mask, because value is not looks like credit card number.

For example in Robin Herbots mask plugin — https://github.com/RobinHerbots/Inputmask — it can be achived using autoUnmask option.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
drugoicommented, May 27, 2017

Sorry, maybe I was not clear in my issue, but the problem with external validators depends on how validators gets data from input with Cleave. In my situation, external validator request value of input after blur event and I can’t add call for getRawValue directly, in this case option like autoUnmask will be good, but not necessary. Btw, I achieved my task with jQuery valHooks:

        var cleave = new Cleave('#iPAN', {
            creditCard: true
        });
        $.valHooks['input'] = {
            get : function(el) {
              if (el.id === 'iPAN') {
                return cleave.getRawValue();
              }
              return el.value;
            },
            set : function(el, val) {
              $(el).html(val);
            }
        };
0reactions
nosircommented, Apr 8, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Default or Base Case in Enums - Pitches - Swift Forums
Hi Swift Enums have raw values and hence are easy to initialise, irrespective of the type of raw value. Recently, Swift has added...
Read more >
Swift enum cannot assign default raw value - Stack Overflow
My understanding is that enum raw values are limited to certain types (Ints, Strings, Booleans, etc). Obviously BestLetters isn't one of those ...
Read more >
Access a raw value for pure enum without using associated type
I can parse a Set of entity instance name as follows and this provides a perfectly formatted string, based on the var ....
Read more >
How the raw values of Int-based enums get incremented
By default, the raw values for an enum backed by Int (or any other numeric) start at zero, and then get incremented by...
Read more >
Swift — Enums - Jullian Mercier
Default values are accessible using the rawValue property. ... When using the rawValue property, Swift will automatically convert your case into a String...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found