Date Auto format with javaScript

javascript

Solution

you can try this javaScript Function and Call it from ` onChange` event of your textbox

function dateFormat(el){
    value = el.value;       
    el.value = value.replace(/^([\d]{4})([\d]{2})([\d]{2})$/,"$1/$2/$3");        
}

Problem

how to make date Auto Format in input textbox with javascript when input `yyyyMMdd` format in textbox, that will automatically change to `yyyy/MM/dd` format for example: if your type `20120427`, that will change to `2012/04/27`

Original source