Link to home
Start Free TrialLog in
Avatar of pranathi27
pranathi27

asked on

Added 2 digits year and adding slashes

hi
i need code which converts 2 digits years to 4 digit years and also add slashes to that date using java script.
Avatar of contactkarthi
contactkarthi
Flag of United States of America image

Avatar of pranathi27
pranathi27

ASKER

this is the function i have which  adds slashes to 4 digit year.but i need to add  some code to this function so that it will convert 2 digit year to 4 digits and also slashes.
function abcd(dd)
{
if (dd.value != "")
        {
            var md = dd.value;
            if ((md.length == 8) && (md.indexOf("/") == -1)  && (md.indexOf("-") == -1))
            {
                           dd.value = md.substring(0,2) + "/" + md.substring(2,4) + "/" + md.substring(4,8);
}
            }

please help
ASKER CERTIFIED SOLUTION
Avatar of James Rodgers
James Rodgers
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks alot Jester!!!!
glad i could help

thanks for the points