
March 20th, 2003, 08:03 PM
|
|
Registered User
|
|
Join Date: Feb 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
not receiving date
I'm trying to display the date of expiration off the calculation of the date_inspection. the date od expiration is 30 days from the date of inspection.<br><br>Can anybody see what's wrong with this code:<br><br><html><br><script language="javascript"><br> <br> function monthsahead() <br> {<br> var newdate = document.inspection.Date_Inspection_Month.value + '/1/' + document.inspection.Date_Inspection_Year.value;<br> var today = new Date(newdate);<br> var noofmonths = document.inspection.Year_TypeDef_Duration_Months.o ptions[document.inspection.Year_TypeDef_Duration_Months.s electedIndex].value;<br> var date = new Date(today.getYear(),today.getMonth() + eval(noofmonths),today.getDate(),today.getHours(), today.getMinutes(),today.getSeconds());<br><br> document.inspection.exp.value = getDisplayDate(date);<br> }<br> function getDisplayDate(passedDate) <br> {<br> // uses getDisplayMonth()<br> // returns passed Date formatted nicely<br> // Month day, Year mmmm dd, yyyy<br><br> theDate = new Date(passedDate);<br><br> // split into day, month, year<br> iDay = theDate.getDate();<br> iMonth = theDate.getMonth();<br> iYear = theDate.getFullYear();<br><br> sDisplayDate = iMonth + eval(1) + "/" + iYear;<br><br> return sDisplayDate;<br> }<br></script><br><br>here's the code inside the connection:<br><br>Response.Write "<TR><td align='center'><b>DATE INSPECTED</td><td colspan='1'><b>STATE NUMBER<td align='right'><b>NATIONAL BOARD #</td><td align='center'><b>EXPIRATION DATE</td></tr>"<br> <br> Response.Write "<tr><td align='center'>" & Date_Inspection & "</td><td align='center'>" & state_no & "</td><td width='20%'>" & Nat_Brd_No & "</td><td align='center'><input type='text' size='10' name='exp'></td></tr>" <img border="0" src="/forum/emoticons/jumpin.gif" height="31" width="31" alt="jumpin" />
|