I am making a game and I want the day to change day by day after each time the player presses a button. For example, "03/21/1741" then "03/22/1741" then "03/23/1741", and so on.It is important to make single digit numbers in this date occur with a zero before the digit(for example, a "7" would be "07" and "3" would be "03").My javascript function skips around, and then starts multiplying the days by five rather than going one by one. I have been looking at it for hours and can't seem to find what I did wrong, but I assume that I am somehow getting stuck within the loop and that's what is causing the multiplying. This is my function for the date...

Code:function MorForm() { if(d=="31"){ d="01"; if(m=="10"){m="11"} if(m=="08"){m="09"} if(m=="07"){m="08"} if(m=="05"){m="06"} if(m=="03"){m="04"} if(m=="01"){m="02"} if(m=="12"){ m="01"; y=y+1; } subForm(); }; if(d=="30"){ if(m=="11"){ m="12"; d="01"; subForm(); } if(m=="09"){ m="10"; d="01"; subForm(); } if(m=="06"){ m="07"; d="01"; subForm(); } if(m=="04"){ m="05"; d="01"; subForm(); } d="31"; subForm(); } if(d=="29"){ d="30"; subForm(); } if(d=="28"){ if(m=="02"){ d="01"; m="03"; subForm(); } d="29"; subForm(); } if(d=="27"){d="28"} if(d=="26"){d="27"} if(d=="25"){d="26"} if(d=="24"){d="25"} if(d=="23"){d="24"} if(d=="22"){d="23"} if(d=="21"){d="22"} if(d=="20"){d="21"} if(d=="19"){d="20"} if(d=="18"){d="19"} if(d=="17"){d="18"} if(d=="16"){d="17"} if(d=="15"){d="16"} if(d=="14"){d="15"} if(d=="13"){d="14"} if(d=="12"){d="13"} if(d=="11"){d="12"} if(d=="10"){d="11"} if(d=="09"){d="10"} if(d=="08"){d="09"} if(d=="07"){d="08"} if(d=="06"){d="07"} if(d=="05"){d="06"} if(d=="04"){d="05"} if(d=="03"){d="04"} if(d=="02"){d="03"} if(d=="01"){d="02"} subForm(); }