I am trying to accomplish a few things hereÖ

1. On submit, have the program display the month/day/year, and not just the year. Iím not sure how to output that extra data.

2. Account for breaks throughout the degree program. Iím trying to put in a dropdown menu of weeks 1 through 5. If the user selects 1 week break, then it simply adds one week onto the graduation date. If a 2 week break is selected, then add two weeks to the graduation date, and so forth.

3. Account for transfer of credits. If a student enters a certain number of credits (not a dropdown menu, but enter an actual integer into a text box) and that number is then multiplied by a variable (certain amount of weeks per credit), which is then further subtracted from the graduation date, bringing that date sooner.

Does that make sense?

Hereís what Iíve got so farÖ


Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="english"> 
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">

<title></title>

<style type="text/css">
body {
    background-color:#f0f0f0;
 }
form {
    width:500px;
    padding:20px;
    border:3px double rgb(128,128,128);
    margin:auto;
    text-align:center;
    background-color:#fff;
    color:rgb(64,64,64)
 }
form div {
    margin:10px 0;
 }
#future-date {
   line-height:1.3em;
 }
</style>

<script type="text/javascript">
(function() {
   'use strict';
    var f;
function init(){
   f=document.forms[0];
   f.reset();
document.getElementById('potential').onclick=function() {
   gradDate();
 }
document.getElementById('clear').onclick=function() {
   document.getElementById('future-date').firstChild.nodeValue='\u00a0';
 }
}
function gradDate() {

   var start_date=document.getElementById('start-date').value;

for(var c=0;c<f.elements.length;c++) {
if((f[c].type=='radio')&&(f[c].checked==true)){
   var grad=parseFloat(f[c].value);
  }
 }
if(isNaN(grad)) {
   alert('Please select your course');
   return;
 }
   var pattern=/^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy)

if(pattern.test(start_date)) {
   var begin=parseFloat(start_date.substr(6,4)); //getting start date 
   var end=grad; //getting course duration  
   var gradDate=begin+end; //calculating graduation date
   document.getElementById('future-date').firstChild.nodeValue='Your potential graduation date is : '+gradDate;
   return;
 } 
else {
   alert('Invalid date format. Please Input in (dd/mm/yyyy) format!');
   return;
  }
 }
   window.addEventListener?
   window.addEventListener('load',init,false):
   window.attachEvent('onload',init);

})();
</script>

</head>
<body>

<form action="#">

<h4>Please select course...</h4>

<div>
   <label for="ass">Associate</label>
    <input id="ass" name="course" type="radio" value="2" />
    <label for="bac">Bachelor</label>
    <input id="bac" name="course" type="radio" value="4" />
    <label for="mas">Master</label>
    <input id="mas" name="course" type="radio" value="2" />
</div>

<h4>Please enter your potential start date (dd/mm/yyyy):</h4>

<div>
 <input id="start-date" type="text">
</div><div>
 <input id="potential" type="button" value="See Your Potential Graduation Date">
 <input id="clear" type="reset" value="clear">
</div>

<div id="future-date">&nbsp;</div>

</form>

</body>
</html>