Skip to content

Instantly share code, notes, and snippets.

Created October 24, 2016 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2428a3e2c6162746e2e7063425b9cac0 to your computer and use it in GitHub Desktop.
Save anonymous/2428a3e2c6162746e2e7063425b9cac0 to your computer and use it in GitHub Desktop.
<input type="digits" id="datum" class="card-input card-input--full" name="dateofbirth" placeholder="Geburtsdatum" ng-model="card.dob" required card-holder maxlength="10" onkeyup="setPoint();return false;"/>
<script type="text/javascript">
<!--
var punkt = 0;
function setPoint(){
var temp = document.getElementById('datum').value;
if((temp.length+1) % 3 == 0 && punkt < 2){
punkt += 1;
document.getElementById('datum').value = temp + '.';
}
}
-->
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment