<script language="javascript"> function myChanged(v) { alert("Hello, value has been changed : "+document.getElementById("date2").value+" ["+v+"]"); } </script> <?php $myCalendar = new tc_calendar("date2", true); $myCalendar->setAutoHide(false); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(1960, date('Y')); $myCalendar->dateAllow('1960-03-01', date('Y-m-d')); //$myCalendar->autoSubmit(true, "form1"); $myCalendar->setAlignment('left', 'bottom'); $myCalendar->disabledDay('sun'); $myCalendar->setSpecificDate(array("2011-04-01", "2011-04-14", "2010-12-25"), 0, 'year'); $myCalendar->setOnChange("myChanged('Test message')"); $myCalendar->writeScript(); ?> </td> <td><input type="button" name="button2" id="button2" value="<?php echo L_CHK_VAL; ?> " onClick="javascript:alert(this.form.date2.value);" class="font"></td> </tr> </table> <p class="largetxt"><b>DatePicker with no input box</b></p> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td nowrap>Date 3 :</td>
<table> <tr> <td> <?php // Call the calendar constructor - use the desired form and format, according to the instructions/samples provided on triconsole.com $myCalendar = new tc_calendar("date1", true); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->zindex = 150; //default 1 $myCalendar->setYearInterval(1995, date('Y')); $myCalendar->dateAllow('1960-03-01', date('Y-m-d')); //$myCalendar->autoSubmit(true, "calendar"); //$myCalendar->setDateFormat('l, dS \of F Y'); $myCalendar->disabledDay("sat"); $myCalendar->disabledDay("sun"); $myCalendar->setSpecificDate(array("2011-04-14", "2010-12-25"), 0, 'month'); $myCalendar->setSpecificDate(array("2011-04-01"), 0, 'year'); $myCalendar->setAlignment('right', 'bottom'); //optional $myCalendar->writeScript(); ?> </td> <tr/> </table> </form> Rest of your page body content <br /> [...] <br /><br />
function CalendarAutoSubmit($strLabel, $strField, $strForm, $strDate = "") { echo "<tr>"; echo "\t<td valign=top>"; echo $strLabel; echo "\t</td>"; echo "\t<td>"; $myCalendar = new tc_calendar($strField); $myCalendar->setIcon("images/iconCalendar.gif"); if (empty($strDate)) { $myCalendar->setDate(date('d'), date('m'), date('Y')); } else { $arr = explode("-", $strDate); $myCalendar->setDate($arr[2], $arr[1], $arr[0]); } $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(1970, 2020); $myCalendar->dateAllow('2008-05-13', '2015-03-01', false); $myCalendar->startMonday(true); $myCalendar->disabledDay("Fri"); $myCalendar->autoSubmit(true, $strForm); $myCalendar->writeScript(); echo "\t</td>"; echo "</tr>"; }