PDA

View Full Version : Jason's Date Input Calendar



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.

max
06-15-2006, 05:52 PM
soory but the trouble is equal if I insert only one caller to script:

<script>DateInput('datainizio', true, 'YYYYMMDD', '20061202')</script>

In fact the question is:
How can modify the value using javascript ? is it possible?

I would to compare the value with a date and after setting new value never update the page with F5 command...

Can you help me please?

max
06-15-2006, 10:10 PM
i try to insert this code in the caller

var Today = new Date();
datainizio.storedMonthObject('YYYYMMDD',Today.getFullYear(), Today.getMonth(), Today.getDate() );

in order to test the external setting but it don't work.



why? :(