I have a calendar grid, which has a heading that states the current month:
I want to also display the months before and after, and I have managed so far:
Within the page, I do have buttons which activate a javascript which displays either the previous, or the following month:
Javascript for the above:
How can I create a hyperlink from the previous or following months now displayed in the table, so the page goes to that month?
Thanks for any help
Code:
print('<TD class=pc align=middle colSpan=31><a href=add_reservation.php>' . $mnth[$month] . '</TD></TR>');
I want to also display the months before and after, and I have managed so far:
Code:
print('<TD class=pc align=middle colSpan=31>' . $mnth[$month-2] . '   ' . $mnth[$month-1] . '   <b class=pb>' . $mnth[$month] . '</b>   ' . $mnth[$month+1] . '   ' . $mnth[$month+2] . '</TD></TR>');
Within the page, I do have buttons which activate a javascript which displays either the previous, or the following month:
Code:
<TD align=left colSpan=4><A class=button
onmouseover="this.className='button_over'"
onfocus="this.className='button_over'"
onmouseout="this.className='button'"
href="javascript:Submit_Action('PREV_MONTH');"> [Previous
Month] </A> </TD>
<TD align=right colSpan=31><A class=button
onmouseover="this.className='button_over'"
onfocus="this.className='button_over'"
onmouseout="this.className='button'"
href="javascript:Submit_Action('NEXT_MONTH');"> [Next
Month] </A></TD>
Javascript for the above:
Code:
function Submit_Action(act)
{
var yy;
var mm;
yy = parseInt(document.frmAvailable.start_cal_year.value);
mm = parseInt(document.frmAvailable.start_cal_month.value);
if (act == "NEXT_MONTH")
{
if(mm==12)
{
mm=1;
yy=yy+1;
}
else
mm=mm+1;
document.frmAvailable.start_cal_year.value = yy;
document.frmAvailable.start_cal_month.value = mm;
document.frmAvailable.action = "add_reservation.php";
document.frmAvailable.submit();
}
else if(act == "PREV_MONTH")
{
if(mm==1)
{
mm=12;
yy=yy-1;
}
else
mm=mm-1;
document.frmAvailable.start_cal_year.value = yy;
document.frmAvailable.start_cal_month.value = mm;
document.frmAvailable.action = "add_reservation.php";
document.frmAvailable.submit();
}
}
How can I create a hyperlink from the previous or following months now displayed in the table, so the page goes to that month?
Thanks for any help