If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Not receiving date

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-20-03, 12:04
Bigced_21 Bigced_21 is offline
Registered User
 
Join Date: Dec 2002
Location: KY
Posts: 54
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.

Can anybody see what's wrong with this code:

<html>
<script language="javascript">

function monthsahead()
{
var newdate = document.inspection.Date_Inspection_Month.value + '/1/' + document.inspection.Date_Inspection_Year.value;
var today = new Date(newdate);
var noofmonths = document.inspection.Year_TypeDef_Duration_Months.o ptions[document.inspection.Year_TypeDef_Duration_Months.s electedIndex].value;
var date = new Date(today.getYear(),today.getMonth() + eval(noofmonths),today.getDate(),today.getHours(), today.getMinutes(),today.getSeconds());

document.inspection.exp.value = getDisplayDate(date);
}
function getDisplayDate(passedDate)
{
// uses getDisplayMonth()
// returns passed Date formatted nicely
// Month day, Year mmmm dd, yyyy

theDate = new Date(passedDate);

// split into day, month, year
iDay = theDate.getDate();
iMonth = theDate.getMonth();
iYear = theDate.getFullYear();

sDisplayDate = iMonth + eval(1) + "/" + iYear;

return sDisplayDate;
}
</script>

here's the code inside the connection:

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>"

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>"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On