Home about IT Motivation Course Sales Project About Me

Monday, January 26, 2009

create calendar javascript for input date at php

please download javascript calender and supporting files at the link:



on the form input please write as below:
<div align="center">
<b><font face="Tahoma" size="2" color="#000000">Surat Setoran Pabean, Cukai, dan Pajak Dalam Rangka Impor</font></b>
<table border="0" cellspacing="1" width="647" id="table1" style="color: #000000; font-family: Tahoma; font-size: 10pt">
<form method="POST" action="send_sspcp.php">
<SCRIPT LANGUAGE="JavaScript" SRC="/sspcp/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT>
<br>
<br>

<tr>
<td align="center" bgcolor="#B2B2B2" colspan="2"><b>
<font face="Tahoma" size="2" color="#000080">Form Input Data</font></b></td>
</tr>

and below for input box :

<tr>
<td bgcolor="#B2B2B2" width="100">Tanggal</td>
<td bgcolor="#F2F2F2">
<SCRIPT LANGUAGE="JavaScript" ID="js1">
var cal1 = new CalendarPopup();
</SCRIPT>
<!-- The next line prints out the source in this example page. It should not be included when you actually use the calendar popup code -->
<SCRIPT LANGUAGE="JavaScript">writeSource("js1");</SCRIPT>
<INPUT TYPE="text" NAME="date1" VALUE="" SIZE=15>
<A HREF="#" onClick="cal1.select(document.forms[0].date1,'anchor1','yyyy-MM-dd'); return false;" TITLE="cal1.select(document.forms[0].date1,'anchor1','MM/dd/yyyy'); return false;" NAME="anchor1" ID="anchor1">select</A>
format: yyyy-mm-dd</td>
</tr>

No comments: