I am stumped on a javascript that is driving me crazy. I would really appreciate any help. The purpose of the website is to get the birthdate and wedding date from the user. Display the age, number of years married and the days of the week that they were born on and married in the text box.
This is what I have so far.
<html>
<head>
<script type="text/javascript">
function getDay(a,b,c)
function showInfo()
{
var msg="", age="", bDay="", wDay="", birthDay="", birthMonth="", birthYear="", wedDay="", wedMonth="", wedYear="", yearsMarried=""
// SAVE FORM DATA TO VARIABLES
birthDay=document.frmDates.birthDay.value
wedDay=document.frmDates.wedDay.value
var bDay=getDay(birthMonth, birthDay, birthYear);
var wDay=getDay(wedMonth, wedDay, wedYear);
<script type="text/javascript">
var d=new Date();
var weekday=new Array(7);
weekday[0]="Sunday";
weekday[1]="Monday";
weekday[2]="Tuesday";
weekday[3]="Wednesday";
weekday[4]="Thursday";
weekday[5]="Friday";
weekday[6]="Saturday";
msg="You were born on a "+birthDay+"\n"+"You are "+age+"years old"+"\n"+"You were married on a "+wedDay+"\n"+"You have been married for "+yearsMarried+"years."
document.frmDates.results.value=msg
}
</script>
</head>
<body bgColor="blue"
//document.write("You were born on a " + weekday[d.getDay()]);
<BODY OnLoad="document.frmDates.birthDay.focus();">
<body onlerror="alert('error in script?')">
<h2 align="center"> Please enter the following information and press submit. </h2>
<p id="err">  </p>
<form name="frmDates">
<b>Your Birthday MM DD YYYY: <input type="text" name="birthMonth" style="width:50px";/><input type="text" name="birthDay" style="width:50px";/><input type="text" name="birthYear" style="width:50px";/><br/><br/>
<b>Your Wedding Day MM DD YYYY: <input type="text" name="wedMonth" style="width:50px";/><input type="text" name="wedDay" style="width:50px";/><input type="text" name="wedYear" style="width:50px";/><br/><br/>
<textarea name="results" cols="110" rows="20"
readonly="readonly"></textarea>
<input type="button" value="Submit" onclick="showInfo(getDay(a,b,c))"/>
<input type="reset" value="Clear form"/>
</form>
</body>
</html>