Created
November 14, 2015 07:18
-
-
Save gerasimua/1573783b5af32a1d0c70 to your computer and use it in GitHub Desktop.
CVV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$body.on('input', '#cvv', function(){ | |
$('#cvv-fake').val(new Array(this.value.length + 1).join('*')); | |
}); | |
<div class="form-group relative"> | |
<label for="cvv" class="sr-only">CVV</label> | |
<input type="cvv" id="cvv-fake" class="form-control" name="cvv" | |
autocomplete="off" placeholder="CVV" title="Card CVV (XXX)" | |
maxlength="3" value="" tabindex="-1"/> | |
<input data-bind="value: cvv" type="cvv" id="cvv" class="form-control" name="cvv" | |
autocomplete="off" placeholder="CVV" title="Card CVV (XXX)" | |
required pattern="\d{3}" maxlength="3" value=""/> | |
</div> | |
input#cvv{ | |
position: absolute; | |
top: 0; | |
opacity: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment