I have this little script here... It adds a "-" after every 4 characters but i need it to not add the - after the 12 character.
$(function(){
$("#promo").keyup(function(){
var $this = $(this);
if ((($this.val().length+1) % 5)==0){
$this.val($this.val() + "-");
}
});
});
But it is adding a "-" at the end of the 12 characters despite my character limit of 14.
i have a JSFiddle here
How would i prevent this from happening?