I am very new to PHP, but am attempting to use PHP to populate a mysql database.
I have a form basically which allows me to manually input the current time. I have written a little javascript routine to generate the current time and I want it to write it to the field where originally I manually input it before I sql it upto the database.
Can anyone help... being new to PHP am I trying to do this the right way... should I be using javascript at all?
Here is an excerpt....
Many thanks for your help..
Dave
I have a form basically which allows me to manually input the current time. I have written a little javascript routine to generate the current time and I want it to write it to the field where originally I manually input it before I sql it upto the database.
Can anyone help... being new to PHP am I trying to do this the right way... should I be using javascript at all?
Here is an excerpt....
Code:
<script type="text/javascript">
function startTime()
{
var today=new Date()
var h=today.getHours()
var m=today.getMinutes()
var s=today.getSeconds()
// add a zero in front of numbers<10
m=checkTime(m)
s=checkTime(s)
document.getElementById('Time').innerHTML=h+":"+m+":"+s
}
function checkTime(i)
{
if (i<10)
{i="0" + i}
return i
}
</script>
<br>
<table border=1 bordercolor=navy cellpadding=0 cellspacing=0>
<tr>
<td>
<div class=TableTitle><%%DETAIL_VIEW_TITLE%%></div>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td colspan=2></td>
<td rowspan=6 valign=top>
<div><%%INSERT_BUTTON%%></div>
<br>
<div><%%UPDATE_BUTTON%%></div>
<div><%%DELETE_BUTTON%%></div>
<div><%%DESELECT_BUTTON%%></div>
</td>
</tr>
<tr>
<td class=TableHeader valign=top>
<div class=TableHeader style="text-align:right;"><input type="button" value="Start Time" onClick="startTime()"></div>
</td>
<td class=TableBody width=300><div id=Time input size=10 type=text class=TextBox name=Type_I_StartTime value="<%%VALUE(Type_I_StartTime)%%>"> </div></td>
</tr>
</table>
</td>
</tr>
</table>
Many thanks for your help..
Dave