kingman65
09-19-2005, 09:03 PM
Greetings,
I am hoping that someone can point out the error that is causing this to go to the year 2006 instead of 2005
<script type="text/javascript"><!--
function getCorrectedYear(year) {
year = year - 0;
if (year < 70) return (2000 + year);
if (year < 1900) return (1900 + year);
return year;}
var today = new Date();
var d = today.getDate() + 1;
var m = today.getMonth() + 1;
var dateString = y + '-' + m + '-' + d;
var y = getCorrectedYear(today.getYear());
this.reservation.iyear.value = y;
this.reservation.iday.value = d;
this.reservation.imonth.value = m;
//--></script>
Once the date is set in the browser window it is submitted using this button and code.
<a
href="http://getdors.com/dors/dorsindex1.php?page=checkdeal&system_id=80&this.reservation.dateString"><img src="images/button-hotdeals.gif" vspace="0" border="0"></a>
But it does not seem to get the date that is entered in the form. The site can be seen in action at http://www.capecodderresort.com the function is on the right hand side of the screen.
Thank you for your help.
I am hoping that someone can point out the error that is causing this to go to the year 2006 instead of 2005
<script type="text/javascript"><!--
function getCorrectedYear(year) {
year = year - 0;
if (year < 70) return (2000 + year);
if (year < 1900) return (1900 + year);
return year;}
var today = new Date();
var d = today.getDate() + 1;
var m = today.getMonth() + 1;
var dateString = y + '-' + m + '-' + d;
var y = getCorrectedYear(today.getYear());
this.reservation.iyear.value = y;
this.reservation.iday.value = d;
this.reservation.imonth.value = m;
//--></script>
Once the date is set in the browser window it is submitted using this button and code.
<a
href="http://getdors.com/dors/dorsindex1.php?page=checkdeal&system_id=80&this.reservation.dateString"><img src="images/button-hotdeals.gif" vspace="0" border="0"></a>
But it does not seem to get the date that is entered in the form. The site can be seen in action at http://www.capecodderresort.com the function is on the right hand side of the screen.
Thank you for your help.