I want to make a form in a system that enable the staff to ask approval for leave from their supervisor. The form contains start date, end date, reason, and name of the supervisors. This system also tends to enable the staff to update the application as long the status still in the process which means their supervisor do not take any action yet whether want to approve or not.
When the staff want to update the application, the same form will be shown, and the reason in the form for update is retrieved from database(SQL server) as what the staff fill in the form during the application. The problem is I can retrieve the start and end date but I can't set the date in datepicker. I want to set the date that retrieved from database as selected date in datepicker.
Can anyone help me ? The image of the application from as shown below.
I'm using Classic ASP and SQL server to develop this web system. This is the code for the application form :
<form name="form1" method="POST" action="TMS_lookCatatanNext.asp" onSubmit="return checkdata();">
<br>
<table width="400" border="1" cellpadding="2" cellspacing="2" class="Kuning">
<tr align="center">
<td colspan="2"><strong>PERMOHONAN PENGESAHAN KEHADIRAN
<%if isdate(KehadiranRS("tarikh"))then%>
<%=day(KehadiranRS("tarikh")) &"/"& month(KehadiranRS("tarikh")) &"/"& year(KehadiranRS("tarikh"))%>
<%end if%>
</strong></td>
</tr>
<tr valign="top">
<td width="23%" align="right"> <strong>Pada :</strong></td>
<td width="77%" <strong>
<input type="date" name="tarikh" id="tarikh"><%=KehadiranRS("tarikh")%>
</strong></td>
</tr>
<tr valign="top">
<td width="23%" align="right"> <strong>Hingga :</strong></td>
<td width="77%"> <strong>
<input type="date" name="hinggaTarikh" id="hinggaTarikh"><%=KehadiranRS("hinggaTarikh")%>
</strong></td>
</tr>
<tr valign="top">
<td width="23%" align="right"> <strong>Catatan :</strong></td>
<td width="77%"> <strong>
<textarea name="alasan" cols="30" rows="6" id="alasan"><%if len(KehadiranRS("alasan"))>0 then%><%=server.HTMLEncode(KehadiranRS("alasan"))%><%end if%></textarea>
</strong></td>
</tr>