I downloaded a popup calendar that works quite nicely and feeds the calendar date selected into the start date field and with a separate call feeds end date field too. I want to populate seven check boxes (days of week) to reflect the start and end dates that were selected. I have tried triggering the function call at the body with onfocus="DowCheckBox_Fmt()" hoping hat as the form refained focus it would see the change and not what I expected, nothing. with the input start/end date using the onchange="DowCheckBox_Fmt()" the same thing is does not see the change. how do you get around this issue?
neither seems to see the new values that the calendar just populated. the code looks like this..
thanks in advance with this help.
<SCRIPT LANGUAGE="JavaScript">
function DowCheckBox_Fmt()
{
document.forms[0].Sunday.checked=false;
document.forms[0].Monday.checked=false;
document.forms[0].Tuesday.checked=false;
document.forms[0].Wednesday.checked=false;
document.forms[0].Thursday.checked=false;
document.forms[0].Friday.checked=false;
document.forms[0].Saturday.checked=false;
var MyStartDate = new Date() ;
<!-- it triggers manually but does not get new value --->
<!-- it does not get new value --->
MyStartDate.value = document.forms[0].StartDate.value ;
alert(MyStartDate);
var DOW_StartDate = MyStartDate.getDay();
alert(DOW_StartDate);
if (DOW_StartDate ==0)
{
document.forms[0].Sunday.checked=true;
}
if (DOW_StartDate ==1)
{
document.forms[0].Monday.checked=true;
}
if (DOW_StartDate ==2)
{
document.forms[0].Tuesday.checked=true;
}
if (DOW_StartDate ==3)
{
document.forms[0].Wednesday.checked=true;
}
if (DOW_StartDate ==4)
{
document.forms[0].Thursday.checked=true;
}
if (DOW_StartDate ==5)
{
document.forms[0].Friday.checked=true;
}
if (DOW_StartDate ==6)
{
document.forms[0].Saturday.checked=true;
}
}
</SCRIPT>
neither seems to see the new values that the calendar just populated. the code looks like this..
thanks in advance with this help.
<SCRIPT LANGUAGE="JavaScript">
function DowCheckBox_Fmt()
{
document.forms[0].Sunday.checked=false;
document.forms[0].Monday.checked=false;
document.forms[0].Tuesday.checked=false;
document.forms[0].Wednesday.checked=false;
document.forms[0].Thursday.checked=false;
document.forms[0].Friday.checked=false;
document.forms[0].Saturday.checked=false;
var MyStartDate = new Date() ;
<!-- it triggers manually but does not get new value --->
<!-- it does not get new value --->
MyStartDate.value = document.forms[0].StartDate.value ;
alert(MyStartDate);
var DOW_StartDate = MyStartDate.getDay();
alert(DOW_StartDate);
if (DOW_StartDate ==0)
{
document.forms[0].Sunday.checked=true;
}
if (DOW_StartDate ==1)
{
document.forms[0].Monday.checked=true;
}
if (DOW_StartDate ==2)
{
document.forms[0].Tuesday.checked=true;
}
if (DOW_StartDate ==3)
{
document.forms[0].Wednesday.checked=true;
}
if (DOW_StartDate ==4)
{
document.forms[0].Thursday.checked=true;
}
if (DOW_StartDate ==5)
{
document.forms[0].Friday.checked=true;
}
if (DOW_StartDate ==6)
{
document.forms[0].Saturday.checked=true;
}
}
</SCRIPT>