max
06-14-2006, 09:05 PM
SCRIPT: Jason's Date Input Calendar
URL: http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm
Hi,
I try your script calendar. It's work vey fine. But I have a trouble. I
should insert 2 dates (Its work fine together) and I should compare its.
I have written:
<form name='dateForm'>
<script>DateInput('datainizio', true, 'YYYYMMDD', '20061202')</script>
<script>DateInput('datafine', true, 'YYYYMMDD', '20051005')</script>
<input type="button" onClick="alert(this.form.datainizio.value)"
value="Show date value passed">
<input type="button" onClick="alert(this.form.datafine.value)"
value="Show date value passed">
<input type="button" onClick="adjustDate()" value="Data">
</form>
and, in the head tag:
<script type="text/javascript">
<!--
function adjustDate() {
i = parseInt(this.dateForm.datainizio.value);
f = parseInt(this.dateForm.datafine.value);
if ( parseInt(i) > parseInt(f) )
{
this.dateForm.datainizio_Month_ID.value =
this.dateForm.datafine_Month_ID.value;
this.dateForm.datainizio_Object.changeMonth(this.dateForm.datainizio_Month_ID);
this.dateForm.datainizio_Day_ID.value =
this.dateForm.datafine_Day_ID.value;
this.dateForm.datainizio_Object.changeDay(this.dateForm.datainizio_Day_ID);
this.dateForm.datainizio_Year_ID.value =
this.dateForm.datafine_Year_ID.value;
this.dateForm.datainizio_Object.changeYear(this.dateForm.datainizio_Year_ID);
}
}
//-->
</script>
but the file don't work.
How I could use your script and compare the date, inserting the second
date into the first if the first date is > of the second?
I hope you answer as soon as possible.
Thanks in advance for your support.
Best regards,
Max.
URL: http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm
Hi,
I try your script calendar. It's work vey fine. But I have a trouble. I
should insert 2 dates (Its work fine together) and I should compare its.
I have written:
<form name='dateForm'>
<script>DateInput('datainizio', true, 'YYYYMMDD', '20061202')</script>
<script>DateInput('datafine', true, 'YYYYMMDD', '20051005')</script>
<input type="button" onClick="alert(this.form.datainizio.value)"
value="Show date value passed">
<input type="button" onClick="alert(this.form.datafine.value)"
value="Show date value passed">
<input type="button" onClick="adjustDate()" value="Data">
</form>
and, in the head tag:
<script type="text/javascript">
<!--
function adjustDate() {
i = parseInt(this.dateForm.datainizio.value);
f = parseInt(this.dateForm.datafine.value);
if ( parseInt(i) > parseInt(f) )
{
this.dateForm.datainizio_Month_ID.value =
this.dateForm.datafine_Month_ID.value;
this.dateForm.datainizio_Object.changeMonth(this.dateForm.datainizio_Month_ID);
this.dateForm.datainizio_Day_ID.value =
this.dateForm.datafine_Day_ID.value;
this.dateForm.datainizio_Object.changeDay(this.dateForm.datainizio_Day_ID);
this.dateForm.datainizio_Year_ID.value =
this.dateForm.datafine_Year_ID.value;
this.dateForm.datainizio_Object.changeYear(this.dateForm.datainizio_Year_ID);
}
}
//-->
</script>
but the file don't work.
How I could use your script and compare the date, inserting the second
date into the first if the first date is > of the second?
I hope you answer as soon as possible.
Thanks in advance for your support.
Best regards,
Max.