Search
 
SCRIPT & CODE EXAMPLE
 

HTML

credit card formatter in html with javascript

<input type='text' onkeypress='return formats(this,event)' onkeyup="return numberValidation(event)" placeholder='Enter Credit Card No' >
<script>
  function formats(ele,e){
    if(ele.value.length<19){
      ele.value= ele.value.replace(/W/gi, '').replace(/(.{4})/g, '$1 ');
      return true;
    }else{
      return false;
    }
  }

  function numberValidation(e){
    e.target.value = e.target.value.replace(/[^d ]/g,'');
    return false;
  }
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: a page with html cheat sheet 
Html :: Text with colour bold 
Html :: react uncontrolled input initial value 
Html :: linux list files onlr 
Html :: slider with steps 
Html :: common web server ports 
Html :: testimonial slider html 
Html :: collapse boostrap 
Html :: how to work on portfolio in html and css 
Html :: venobox cdn 
Html :: html entity for $ 
Html :: what are the tags in html that every website have 
Html :: how to use bootstrap 
Html :: HTML HOW TO MAKE QUOTE 
Html :: add title attribute 
Html :: md-autocomplete 
Html :: proper center grid 
Html :: jquery html button 
Html :: making spinner in css 
Html :: delete html file from git 
Html :: how to change the url of a website in html 
Html :: metro ui 
Html :: create a close x button in html 
Html :: html center 
Html :: add text to pdf footer html 
Html :: Double quotation for meta tag strings on html 
Html :: angular variable in html 
Html :: html check observable is null 
Html :: html cite element 
Html :: Aria hr role 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =