Firefox y2K issue?
Posted on 2005-05-02
var oDate = document.getElementById(theDate);
var today = new Date();
oDate.value = (today.getMonth() + 1) + '/' + today.getDate() + '/' + today.getYear();
if (document.theForm.Status.value == "I")
return(confirm("Are you sure you want to Inactivate your account?\n\nThis will mean that you will no longer be active in the RepHunter.net\ndatabase, and that you will not be able to log in to your account?"));
This code is triggered via the ONCHANGE attrbitute of a SELECT. A side effect of the function is to change the value of a date field, with the formal parameter "theDate".
In IE, the field is populated with a value such as '5/2/2005'. However, in Firefox, the field is populated with the value '5/2/105', which leads to an SQL Server error when trying to write into a date field.
Can anyone give me the fix for this?